Skip to content

Commit

Permalink
dependabot: only commit NOTICE.txt if it changed (#13751)
Browse files Browse the repository at this point in the history
  • Loading branch information
reakaleek authored Jul 24, 2024
1 parent fdc249e commit 527ed64
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/update-dependabot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@ jobs:
go-version-file: go.mod
- name: Update NOTICE.txt
run: make notice
- name: Check if NOTICE.txt has changed
id: check-notice-diff
run: |
git diff --exit-code NOTICE.txt
result="$?"
if [[ "$result" -eq 0 ]]; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
# inspired by https://gist.github.com/swinton/03e84635b45c78353b1f71e41007fc7c
- name: Commit changes (signed)
if: steps.check-notice-diff.outputs.changed
run: |
export BRANCH=${GITHUB_REF#refs/heads/}
export SHA=$(git rev-parse "$BRANCH:$FILE_TO_COMMIT")
Expand Down

0 comments on commit 527ed64

Please sign in to comment.