Skip to content

Commit

Permalink
fix: adjust create PR job
Browse files Browse the repository at this point in the history
  • Loading branch information
undead404 committed Mar 21, 2024
1 parent ab7308e commit 3d88afa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ jobs:
id: check-if-pr-exists
name: Check if PR exists
run: |
gh pr list --state open --base master --head ${GITHUB_REF#refs/heads/} | grep -q "No open pull requests"
if [ $? -eq 0 ]; then
echo "No open pull requests"
prs=$(gh pr list \
--head ${GITHUB_REF#refs/heads/} \
--base 'master' \
--json title \
--jq 'length')
if ((prs > 0)); then
echo "skip=false" >> "$GITHUB_OUTPUT"
else
echo "Open pull requests"
echo "PR exists"
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- env:
Expand Down

0 comments on commit 3d88afa

Please sign in to comment.