File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 3232 env :
3333 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3434
35- - name : Create and push changes if needed
35+ - name : Check for existing PR
3636 if : env.FIX_NEEDED == 'true'
37+ id : check_pr
38+ run : |
39+ EXISTING_PR=$(gh pr list --state open --search "Fix whitespace issues" --json number -q '.[].number')
40+ if [[ -n "$EXISTING_PR" ]]; then
41+ echo "EXISTING_PR=true" >> $GITHUB_ENV
42+ fi
43+ env :
44+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+
46+ - name : Create and push changes if needed
47+ if : env.FIX_NEEDED == 'true' && env.EXISTING_PR != 'true'
3748 id : create_branch
3849 run : |
3950 git config user.name "github-actions[bot]"
4960 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5061
5162 - name : Open Pull Request
52- if : env.FIX_NEEDED == 'true'
63+ if : env.FIX_NEEDED == 'true' && env.EXISTING_PR != 'true'
5364 uses : repo-sync/pull-request@v2
5465 with :
5566 source_branch : ${{ env.branch_name }}
You can’t perform that action at this time.
0 commit comments