File tree Expand file tree Collapse file tree 3 files changed +58
-16
lines changed Expand file tree Collapse file tree 3 files changed +58
-16
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ version : 2
2+ updates :
3+ - package-ecosystem : npm
4+ directory : " /"
5+ schedule :
6+ interval : daily
7+ open-pull-requests-limit : 1000000
8+ - package-ecosystem : bundler
9+ directory : " /docs"
10+ schedule :
11+ interval : daily
12+ open-pull-requests-limit : 1000000
Original file line number Diff line number Diff line change 1+ name : Dependabot auto-merge
2+ on : pull_request
3+
4+ permissions :
5+ pull-requests : write
6+ contents : write
7+
8+ jobs :
9+ dependabot :
10+ runs-on : ubuntu-latest
11+ if : ${{ github.actor == 'dependabot[bot]' }}
12+ steps :
13+ - name : Enable auto-merge for Dependabot PRs
14+ env :
15+ PR_URL : ${{github.event.pull_request.html_url}}
16+ GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
17+ run : |
18+ function get_pending_jobs() {
19+ gh pr view "$PR_URL" --json statusCheckRollup --jq '.statusCheckRollup | map(select(.name != "dependabot")) | map(select(.status != "COMPLETED")).[]'
20+ }
21+
22+ function get_failed_jobs() {
23+ gh pr view "$PR_URL" --json statusCheckRollup --jq '.statusCheckRollup | map(select(.name != "dependabot")) | map(select(.conclusion != "SUCCESS")).[]'
24+ }
25+
26+ function wait_until_completed() {
27+ while [[ $(get_pending_jobs) ]]
28+ do
29+ sleep 5
30+ done
31+ }
32+
33+ function fail_if_unsuccessful() {
34+ if [[ $(get_failed_jobs) ]]; then
35+ echo "Some jobs failed, unable to automerge"
36+ exit 1
37+ fi
38+ }
39+
40+ function auto_merge() {
41+ gh pr merge --auto --rebase "$PR_URL"
42+ }
43+
44+ wait_until_completed && \
45+ fail_if_unsuccessful && \
46+ auto_merge
You can’t perform that action at this time.
0 commit comments