Skip to content

Commit

Permalink
Simplify commit and PR steps
Browse files Browse the repository at this point in the history
Signed-off-by: egibs <[email protected]>
  • Loading branch information
egibs committed Nov 1, 2024
1 parent 917d083 commit 00658f2
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/third-party.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_dispatch:
schedule:
- cron: "0 */12 * * *"
push:
branches:
- third-party-no-op-fix

permissions:
contents: read
Expand Down Expand Up @@ -42,26 +45,15 @@ jobs:
- name: Run make refresh-test-data
run: |
make refresh-sample-testdata
- name: Retrieve changes
id: check
- name: Commit changes and create PR
run: |
echo "CHANGES=$(git status -s | wc -l)" >> $GITHUB_OUTPUT
- name: Add and commit changes
if: ${{ steps.check.outputs.CHANGES }} > 0
id: commit
run: |
DATE=$(date +%F)
BRANCH="third-party-rule-update-${DATE}"
git checkout -b $BRANCH
git add .
git commit -m "Update third-party rules as of ${DATE}"
git push origin $BRANCH
if [[ -n $(git status -s) ]]; then
DATE=$(date +%F)
BRANCH="third-party-rule-update-${DATE}"
git checkout -b $BRANCH
git add .
git commit -m "Update third-party rules as of ${DATE}"
git push origin $BRANCH
echo "DATE=${DATE}" >> $GITHUB_OUTPUT
- name: Create Pull Request
if: ${{ steps.check.outputs.CHANGES }} > 0
env:
GH_TOKEN: ${{ steps.octo-sts.outputs.token }}
run: |
DATE=${{ steps.commit.outputs.DATE }}
gh pr create -t "Update third-party rules as of ${DATE}" -b "${DATE} third-party rule update for malcontent." -B main
gh pr create -t "Update third-party rules as of ${DATE}" -b "${DATE} third-party rule update for malcontent." -B main
fi

0 comments on commit 00658f2

Please sign in to comment.