Skip to content

Commit

Permalink
Don't push to existing PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielfeo committed Apr 24, 2023
1 parent 7a262ce commit ad54b51
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/check-new-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ jobs:
echo "NEW_VERSION=$(cat new.txt)" >> $GITHUB_ENV
fi
rm new.txt || true
- name: Check for existing PR
if: ${{ env.NEW_VERSION }}
run: |
set -u
echo "UPDATE_BRANCH='feature/api-spec-$NEW_VERSION'" >> $GITHUB_ENV
if git ls-remote --exit-code --heads origin "$UPDATE_BRANCH"; then
echo "EXISTING_PR=true" >> $GITHUB_ENV
fi
- name: 'Create PR'
if: ${{ !inputs.dry_run && env.NEW_VERSION }}
if: ${{ !inputs.dry_run && env.NEW_VERSION && !env.EXISTING_PR }}
uses: peter-evans/create-pull-request@v5
with:
branch: "feature/api-spec-${{ env.NEW_VERSION }}"
branch: "${{ env.UPDATE_BRANCH }}"
commit-message: "Bump GE API spec version to ${{ env.NEW_VERSION }}"
title: "Bump GE API spec version to ${{ env.NEW_VERSION }}"
body: "https://docs.gradle.com/enterprise/api-manual/#release_history"
Expand Down

0 comments on commit ad54b51

Please sign in to comment.