File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 3333 env :
3434 OVERLEAF_TOKEN : ${{ secrets.OVERLEAF_TOKEN }}
3535 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36- - name : create pull request
36+ - name : check for existing PRs
37+ id : check_for_existing_PRs
3738 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'))
3851 run : gh pr create -B master -H sync_overleaf --title 'Merge sync_overleaf into master' --body 'Created by Github action'
3952 env :
4053 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments