File tree Expand file tree Collapse file tree 2 files changed +18
-20
lines changed
Expand file tree Collapse file tree 2 files changed +18
-20
lines changed Original file line number Diff line number Diff line change 5454 else
5555 echo "All jobs completed successfully"
5656 fi
57-
58- dependabot :
59- needs :
60- - all
61- uses : ./.github/workflows/dependabot.yml
Original file line number Diff line number Diff line change 1- name : Automatic Actions for Dependabot PRs
1+ name : dependabot
2+
23on :
3- workflow_call :
4+ push :
5+ branches :
6+ - ' dependabot/**'
47
58permissions :
6- contents : write
79 pull-requests : write
10+ contents : write
811
912jobs :
1013 approve-and-merge :
1114 runs-on : ubuntu-latest
12- if : github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'spack/spack-distroless'
15+ if : ${{ github.actor == 'dependabot[bot]' && github.repository == 'spack/spack-distroless'}}
1316 steps :
14- - name : Dependabot metadata
15- id : metadata
16- uses : dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7
17- with :
18- github-token : " ${{ secrets.GITHUB_TOKEN }}"
17+ - name : Get PR associated with Branch
18+ id : branch
19+ run : echo "url=$(gh pr list --head ${GITHUB_REF##*/} --json url --template '{{range .}}{{.url}}{{end}}')\n" >> "$GITHUB_OUTPUT"
20+ env :
21+ GITHUB_REF : ${{ github.ref_name }}
1922
20- - name : Approve Dependabot PRs
23+ - name : Auto Approve Dependabot PRs
2124 run : gh pr review --approve "$PR_URL"
2225 env :
23- PR_URL : ${{github.event.pull_request.html_url }}
24- GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
26+ PR_URL : ${{ steps.branch.outputs.url }}
27+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2528
2629 - name : Enable auto-merge for Dependabot PRs
27- run : gh pr merge --auto --merge "$PR_URL"
30+ run : gh pr merge --auto --squash "$PR_URL"
2831 env :
29- PR_URL : ${{github.event.pull_request.html_url }}
30- GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
32+ PR_URL : ${{ steps.branch.outputs.url }}
33+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments