Skip to content

Commit

Permalink
Use env again, only run 'Check for changes' on push
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Jul 23, 2024
1 parent 24addd7 commit fad4a17
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/sync-backport-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,17 @@ jobs:
)
steps:
- name: Checkout
if: github.event_name == 'push'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 2 # Fetch the last two commits to compare changes
- name: Check for changes in backport-changelog
id: check-for-changes
if: github.event_name == 'push'
run: |
git diff --quiet HEAD^ HEAD -- backport-changelog || echo "HAS_CHANGES=1" >> "$GITHUB_OUTPUT"
if git diff --quiet HEAD^ HEAD -- backport-changelog; then
echo "skip_sync=true" >> "$GITHUB_ENV"
fi
- name: Sync Issue
if: >
steps.check-for-changes.outputs.HAS_CHANGES ||
(
github.event_name == 'issues' &&
github.event.action == 'labeled' &&
github.event.label.name == '🤖 Sync Backport Changelog'
)
if: ${{ ! env.skip_sync }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down

0 comments on commit fad4a17

Please sign in to comment.