-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Abort if resulting pull would end up with no changes
- Loading branch information
1 parent
6dd0bf4
commit b298d1f
Showing
1 changed file
with
7 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,16 +26,14 @@ 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 | ||
exit 1 | ||
if [[ $(git diff --stat "$(git log -1 --skip=2 --format=%H)" "$(git log -1 --format=%H)") -eq 0 ]]; then | ||
echo "automerge_pull_action=close" >> "$GITHUB_ENV" | ||
else | ||
echo "automerge_pull_action=merge" >> "$GITHUB_ENV" | ||
fi | ||
fi | ||
automerge: | ||
runs-on: ubuntu-latest | ||
needs: package_json | ||
if: ${{ github.actor == 'dependabot[bot]' && needs.package_json.result == 'success' }} | ||
steps: | ||
- name: automerge | ||
if: ${{ github.actor == 'dependabot[bot]' && env.automerge_pull_action == 'merge' }} | ||
uses: actions/[email protected] | ||
with: | ||
script: | | ||
|
@@ -45,13 +43,8 @@ jobs: | |
pull_number: context.payload.pull_request.number, | ||
merge_method: 'merge' | ||
}) | ||
close: | ||
runs-on: ubuntu-latest | ||
needs: package_json | ||
if: ${{ github.actor == 'renovate[bot]' && needs.package_json.result == 'success' }} | ||
steps: | ||
- name: Close Pull | ||
- name: close | ||
if: ${{ github.actor == 'renovate[bot]' || (github.actor == 'dependabot[bot]' && env.automerge_pull_action == 'close') }} | ||
uses: peter-evans/[email protected] | ||
continue-on-error: true | ||
with: | ||
delete-branch: true |