Skip to content

Commit

Permalink
fix(releases): duplicate PR generation (#587)
Browse files Browse the repository at this point in the history
* ci(releases): duplicate PR generation

* testing

* testing

* testing

* revert: test changes
  • Loading branch information
mehulmathur16 authored Dec 29, 2024
1 parent c426e24 commit a216bd1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/update-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
update-releases:
if: github.ref == 'refs/heads/develop'
if: github.repository == 'tailcallhq/tailcallhq.github.io' && github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest

steps:
Expand All @@ -24,6 +24,18 @@ jobs:
with:
node-version: 20

- name: Check for Existing Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXISTING_PR=$(gh pr list --state open --base develop --json headRefName --jq '.[] | select(.headRefName | startswith("update-releases")) | .headRefName')
if [ -n "$EXISTING_PR" ]; then
echo "An existing PR is already open. Exiting workflow."
exit 1
else
echo "No existing PR found. Proceeding with new PR creation."
fi
- name: Run npm Install
run: npm install

Expand All @@ -32,7 +44,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node release-notes-generator.js

- name: Create pull request
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit a216bd1

Please sign in to comment.