File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 32
32
env :
33
33
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
34
35
- - name : Create and push changes if needed
35
+ - name : Check for existing PR
36
36
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'
37
48
id : create_branch
38
49
run : |
39
50
git config user.name "github-actions[bot]"
49
60
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50
61
51
62
- name : Open Pull Request
52
- if : env.FIX_NEEDED == 'true'
63
+ if : env.FIX_NEEDED == 'true' && env.EXISTING_PR != 'true'
53
64
uses : repo-sync/pull-request@v2
54
65
with :
55
66
source_branch : ${{ env.branch_name }}
You can’t perform that action at this time.
0 commit comments