Skip to content

Commit

Permalink
Add all file modifications in a single commit (#3355)
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman authored Mar 13, 2024
1 parent 20a5222 commit 15ffc2d
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,22 @@ jobs:
with:
go-version-file: .go-version

- name: run go mod tidy in testing/
run: cd testing; go mod tidy

- name: check for modified testing/go.mod or testing/go.sum
id: testing-mod-check
run: echo "modified=$(if git diff-index --quiet HEAD -- testing/go.mod testing/go.sum; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT

- name: commit testing/go.mod and testing/go.sum files
if: steps.testing-mod-check.outputs.modified == 'true'
run: |
git config --global user.name 'dependabot[bot]'
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
git add testing/go.mod testing/go.sum
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -m "Update testing/go.mod and testing/go.sum files"
git push
- name: update NOTICE.txt
run: make notice

- name: check for modified NOTICE.txt
id: notice-check
run: echo "modified=$(if git diff-index --quiet HEAD -- NOTICE.txt; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT
- name: run go mod tidy in testing/
run: cd testing; go mod tidy

- name: check for modified files
id: check-files
run: echo "modified=$(if git diff-index --quiet HEAD -- NOTICE.txt testing/go.mod testing/go.sum; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT

- name: commit NOTICE.txt
if: steps.notice-check.outputs.modified == 'true'
- name: commit modified files
if: steps.check-files.outputs.modified == 'true'
run: |
git config --global user.name 'dependabot[bot]'
git config --global user.email 'dependabot[bot]@users.noreply.github.com'
git add NOTICE.txt
git add NOTICE.txt testing/go.mod testing/go.sum
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -m "Update NOTICE.txt"
git commit -m "Post dependabot file modifications"
git push

0 comments on commit 15ffc2d

Please sign in to comment.