Skip to content

Commit 4d41101

Browse files
authored
More BOT_PATH fixes (#177)
* More BOT_PATH fixes * Log github context
1 parent 7b3aa5b commit 4d41101

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/ack.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
ack:
1616
runs-on: ubuntu-latest
1717
environment: ack
18+
env:
19+
BOT_PAT: ${{ secrets.BOT_PAT }}
1820
permissions:
1921
checks: write
2022
contents: write # needed to update release
@@ -61,8 +63,6 @@ jobs:
6163

6264
- name: Add issue or pull-request to 'devtools' project
6365
# Workaround for running this step only if BOT_PAT secret is found
64-
env:
65-
BOT_PAT: ${{ secrets.BOT_PAT }}
6666
if: env.BOT_PAT != null
6767
uses: actions/add-to-project@main
6868
with:
@@ -73,16 +73,21 @@ jobs:
7373
# labeled: skip-changelog
7474
# label-operator: NOT
7575

76+
- name: Dump GitHub context
77+
env:
78+
GITHUB_CONTEXT: ${{ toJson(github) }}
79+
run: echo "$GITHUB_CONTEXT"
80+
7681
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request
7782
- 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)
7984
run: gh pr merge --auto --squash "$PR_URL"
8085
env:
8186
PR_URL: ${{ github.event.pull_request.html_url }}
8287
GH_TOKEN: ${{ secrets.BOT_PAT || secrets.GITHUB_TOKEN }}
8388

8489
- 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)
8691
run: gh pr review --approve "$PR_URL"
8792
env:
8893
PR_URL: ${{github.event.pull_request.html_url}}

0 commit comments

Comments
 (0)