15
15
ack :
16
16
runs-on : ubuntu-latest
17
17
environment : ack
18
+ env :
19
+ BOT_PAT : ${{ secrets.BOT_PAT }}
18
20
permissions :
19
21
checks : write
20
22
contents : write # needed to update release
61
63
62
64
- name : Add issue or pull-request to 'devtools' project
63
65
# Workaround for running this step only if BOT_PAT secret is found
64
- env :
65
- BOT_PAT : ${{ secrets.BOT_PAT }}
66
66
if : env.BOT_PAT != null
67
67
uses : actions/add-to-project@main
68
68
with :
@@ -73,16 +73,21 @@ jobs:
73
73
# labeled: skip-changelog
74
74
# label-operator: NOT
75
75
76
+ - name : Dump GitHub context
77
+ env :
78
+ GITHUB_CONTEXT : ${{ toJson(github) }}
79
+ run : echo "$GITHUB_CONTEXT"
80
+
76
81
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
77
82
- name : Enable auto-merge for safe bots PRs
78
- if : env.BOT_PAT != null && contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.actor )
83
+ if : env.BOT_PAT != null && contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.event.pull_request.user.login )
79
84
run : gh pr merge --auto --squash "$PR_URL"
80
85
env :
81
86
PR_URL : ${{ github.event.pull_request.html_url }}
82
87
GH_TOKEN : ${{ secrets.BOT_PAT || secrets.GITHUB_TOKEN }}
83
88
84
89
- name : Approve a PR
85
- if : env.BOT_PAT != null && contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.actor )
90
+ if : env.BOT_PAT != null && contains(fromJson('["dependabot[bot]", "pre-commit-ci[bot]"]'), github.event.pull_request.user.login )
86
91
run : gh pr review --approve "$PR_URL"
87
92
env :
88
93
PR_URL : ${{github.event.pull_request.html_url}}
0 commit comments