@@ -2,7 +2,7 @@ name: Update Checkov Severity Mapping
2
2
3
3
on :
4
4
# schedule:
5
- # - cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
5
+ # - cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
6
6
workflow_dispatch : # Allows manual trigger from the GitHub UI
7
7
8
8
jobs :
@@ -43,12 +43,31 @@ jobs:
43
43
run : |
44
44
git add checkov_policy_severity.ts
45
45
git status
46
- git diff --staged --exit-code || echo "::set-output name=changed::true"
46
+ git diff --staged --exit-code || echo "changed=true" >> $GITHUB_ENV
47
+
48
+ - name : Generate branch name
49
+ run : echo "BRANCH_NAME=update-checkov-severity-$(date +%s)" >> $GITHUB_ENV
47
50
48
51
- name : Commit changes
49
- if : steps.git_status.outputs .changed == 'true'
52
+ if : env .changed == 'true'
50
53
run : |
51
- git config --local user.email "github-actions[bot]@users.noreply.github.com"
52
- git config --local user.name "github-actions[bot]"
54
+ git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
55
+ git config user.name 'github-actions[bot]'
56
+ git checkout -b $BRANCH_NAME
53
57
git commit -m "Update Checkov severity mapping"
54
- git push origin main
58
+
59
+ - name : Push changes
60
+ if : env.changed == 'true'
61
+ run : |
62
+ git push origin HEAD
63
+
64
+ - name : Create Pull Request
65
+ if : env.changed == 'true'
66
+ uses : peter-evans/create-pull-request@v4
67
+ with :
68
+ token : ${{ secrets.GITHUB_TOKEN }}
69
+ commit-message : " Update Checkov severity mapping"
70
+ branch : $BRANCH_NAME
71
+ title : " Update Checkov severity mapping"
72
+ body : " Automated update of Checkov severity mapping"
73
+ labels : automated update
0 commit comments