File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 33
33
env :
34
34
OVERLEAF_TOKEN : ${{ secrets.OVERLEAF_TOKEN }}
35
35
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36
- - name : create pull request
36
+ - name : check for existing PRs
37
+ id : check_for_existing_PRs
37
38
if : steps.sync_overleaf.outputs.commitDiffCount > 0
39
+ run : |
40
+ prs=$(gh pr list \
41
+ --repo "$GITHUB_REPOSITORY" \
42
+ --head 'sync_overleaf' \
43
+ --base 'master' \
44
+ --json 'Merge sync_overleaf into master' \
45
+ --jq 'length')
46
+ if ((prs > 0)); then
47
+ echo "skip=true" >> "$GITHUB_OUTPUT"
48
+ fi
49
+ - name : create pull request
50
+ if : ((steps.sync_overleaf.outputs.commitDiffCount > 0) && (steps.check_for_existing_PRs.outputs.skip != 'true'))
38
51
run : gh pr create -B master -H sync_overleaf --title 'Merge sync_overleaf into master' --body 'Created by Github action'
39
52
env :
40
53
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments