File tree 2 files changed +30
-8
lines changed
2 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 25
25
- uses : actions/setup-python@v4
26
26
with :
27
27
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
+
28
55
- name : Setup Cloud Formation Linter with Latest Version
29
56
uses : scottbrenner/cfn-lint-action@v2
30
57
- name : Print the Cloud Formation Linter Version & Run Linter.
47
74
npm cache clean --force
48
75
npm install
49
76
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
55
77
- 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
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Resources:
27
27
Handler : lib/main.handler
28
28
Policies :
29
29
- AmazonSSMReadOnlyAccess
30
- Runtime : nodejs14 .x
30
+ Runtime : nodejs20 .x
31
31
Timeout : 60
32
32
Tracing : Active
33
33
@@ -43,7 +43,7 @@ Resources:
43
43
Handler : lib/main.handler
44
44
Policies :
45
45
- AmazonSSMReadOnlyAccess
46
- Runtime : nodejs14 .x
46
+ Runtime : nodejs20 .x
47
47
Timeout : 60
48
48
Tracing : Active
49
49
You can’t perform that action at this time.
0 commit comments