Skip to content

Commit 1a19dfd

Browse files
committed
Merge branch 'main' into dependabot/npm_and_yarn/dependencies-1a4bdb1832
2 parents 8457e8f + 269b1de commit 1a19dfd

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

.github/workflows/deploy.yaml

+28-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,33 @@ jobs:
2525
- uses: actions/setup-python@v4
2626
with:
2727
python-version: "3.12"
28+
29+
- name: Extract branch name
30+
id: extract_branch
31+
shell: bash
32+
run: |
33+
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
34+
35+
- name: Clean up Branch Name (Valid for CloudFormation Stack Name)
36+
id: formatted_branch
37+
env:
38+
DATA: ${{ steps.extract_branch.outputs.branch }}
39+
run: |
40+
noSpecialChars="$(echo "$DATA" | sed 's/[^a-zA-Z0-9 ]//g')" # Removing any character apart from numbers letters and spaces
41+
lowercase="$(echo "$noSpecialChars" | awk '{print tolower($0)}')" # Making Lowercase
42+
lowercaseDashRepoName="$(echo ${lowercase// /-})" # Replacing spaces with dashses
43+
44+
if [ ${#lowercaseDashRepoName} -gt 100 ]; then
45+
lowercaseDashRepoName=${lowercaseDashRepoName:0:100} # Limiting to only 100 characters
46+
fi
47+
48+
echo "BRANCH=$(echo "$lowercaseDashRepoName")" >> "$GITHUB_OUTPUT"
49+
50+
- name: Echo'ing Branch Names (For Debugging)
51+
run: |
52+
echo ${{ steps.formatted_branch.outputs.BRANCH }}
53+
echo ${{ steps.extract_branch.outputs.branch }}
54+
2855
- name: Setup Cloud Formation Linter with Latest Version
2956
uses: scottbrenner/cfn-lint-action@v2
3057
- name: Print the Cloud Formation Linter Version & Run Linter.
@@ -47,10 +74,5 @@ jobs:
4774
npm cache clean --force
4875
npm install
4976
npm run build
50-
- name: Extract branch name
51-
id: extract_branch
52-
shell: bash
53-
run: |
54-
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
5577
- run: sam build --use-container
56-
- run: sam deploy --debug --no-confirm-changeset --no-fail-on-empty-changeset --stack-name CodeScanningToSlackStack-${{ steps.extract_branch.outputs.branch }} --capabilities CAPABILITY_IAM --region ${{ env.REGION }} --resolve-s3
78+
- run: sam deploy --debug --no-confirm-changeset --no-fail-on-empty-changeset --stack-name CodeScanningToSlackStack-${{ steps.formatted_branch.outputs.BRANCH }} --capabilities CAPABILITY_IAM --region ${{ env.REGION }} --resolve-s3

template.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Resources:
2727
Handler: lib/main.handler
2828
Policies:
2929
- AmazonSSMReadOnlyAccess
30-
Runtime: nodejs14.x
30+
Runtime: nodejs20.x
3131
Timeout: 60
3232
Tracing: Active
3333

@@ -43,7 +43,7 @@ Resources:
4343
Handler: lib/main.handler
4444
Policies:
4545
- AmazonSSMReadOnlyAccess
46-
Runtime: nodejs14.x
46+
Runtime: nodejs20.x
4747
Timeout: 60
4848
Tracing: Active
4949

0 commit comments

Comments
 (0)