Skip to content

Commit

Permalink
Add pull request existence check to version check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hiletmis committed Nov 8, 2024
1 parent 7162b2b commit b090ba2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ jobs:
commit_message: Fetch updated logos from Dropbox
commit_options: '--no-verify --signoff'
push_options: '--force'
- name: Check if PR exists
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs=$(gh pr list \
--repo "logos" \
--head 'control-branch' \
--base 'main' \
--jq 'length')
if ((prs > 0)); then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- name: Check if pull request exists
if: '!steps.check.outputs.skip'
run: echo "Pull request already exists"

- name: Create pull request
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: gh pr create -B main -H control-branch --title 'Check logo updates' --body 'This PR checks for logo updates'
Expand Down

0 comments on commit b090ba2

Please sign in to comment.