File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Merge Dependabot PRs
2+ on :
3+ schedule :
4+ - cron : ' 0 12 * * 5' # Run this workflow every Friday at 12:00
5+ workflow_dispatch :
6+
7+ jobs :
8+ merge :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Check out code
12+ uses : actions/checkout@v2
13+
14+ - name : Authenticate GitHub CLI
15+ run : echo "${{ secrets.DEPENDABOT_MERGER_PAT }}" | gh auth login --with-token
16+
17+ - name : Ensure test branch is up to date with master
18+ run : |
19+ git checkout master
20+ git pull
21+ git checkout dependabot-test-branch
22+ git merge master
23+
24+ - name : Get list of PRs from dependabot
25+ id : pr_list
26+ run : |
27+ echo "::set-output name=numbers::$(gh pr list --author 'dependabot[bot]' --state open --json number --jq '.[] .number')"
28+
29+ - name : Merge PRs into test branch
30+ run : |
31+ IFS=' ' read -r -a array <<< "${{ steps.pr_list.outputs.numbers }}"
32+ for PR_NUMBER in "${array[@]}"
33+ do
34+ gh pr merge $PR_NUMBER --merge --repo ${{ github.repository }} --branch dependabot-test-branch
35+ done
You can’t perform that action at this time.
0 commit comments