Skip to content

Commit

Permalink
Abort if resulting pull would end up with no changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvanrijn committed Sep 29, 2023
1 parent 6dd0bf4 commit f4d7c5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions: write-all
jobs:
package_json:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]' }}
steps:
- uses: actions/[email protected]
continue-on-error: true
Expand All @@ -26,7 +27,7 @@ jobs:
git add package.json
git -c user.name="GitHub" -c user.email="[email protected]" commit --author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" -m"Fix package.json" | sed -n 1p || true
git push
if [[ $(git status --porcelain | tee /dev/stderr | head -c1 | wc -c) -ne 0 || $(git clean -dffx | tee /dev/stderr | head -c1 | wc -c) -ne 0 ]]; then
if [[ $(git diff --stat $(git log -1 --skip=2 --format=%H) $(git log -1 --format=%H)) -eq 0 || $(git status --porcelain | tee /dev/stderr | head -c1 | wc -c) -ne 0 || $(git clean -dffx | tee /dev/stderr | head -c1 | wc -c) -ne 0 ]]; then
exit 1
fi
fi
Expand Down

0 comments on commit f4d7c5d

Please sign in to comment.