Skip to content

Commit feda2da

Browse files
feat PR
1 parent 003190d commit feda2da

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

.github/workflows/checkovScrapper.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Update Checkov Severity Mapping
22

33
on:
44
# schedule:
5-
# - cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
5+
# - cron: "0 0 * * 0" # Runs every Sunday at midnight UTC
66
workflow_dispatch: # Allows manual trigger from the GitHub UI
77

88
jobs:
@@ -43,12 +43,31 @@ jobs:
4343
run: |
4444
git add checkov_policy_severity.ts
4545
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
4750

4851
- name: Commit changes
49-
if: steps.git_status.outputs.changed == 'true'
52+
if: env.changed == 'true'
5053
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
5357
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

Comments
 (0)