2424 if : >
2525 github.event.issue.pull_request &&
2626 github.event.issue.state != 'closed' &&
27- github.actor != 'asyncapi-bot' &&
27+ github.event.comment.user.login != 'asyncapi-bot' &&
2828 (
2929 contains(github.event.comment.body, '/ready-to-merge') ||
3030 contains(github.event.comment.body, '/rtm' )
@@ -33,11 +33,14 @@ jobs:
3333 runs-on : ubuntu-latest
3434 steps :
3535 - name : Add ready-to-merge label
36- uses : actions/github-script@v7
36+ uses : actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
3737 env :
3838 GITHUB_ACTOR : ${{ github.actor }}
3939 with :
40- github-token : ${{ github.token }}
40+ # Use bot PAT, not the default GITHUB_TOKEN: events created by
41+ # GITHUB_TOKEN do not trigger other workflows, so `Automerge For
42+ # Humans` would never see the `labeled` event.
43+ github-token : ${{ secrets.GH_TOKEN }}
4144 script : |
4245 const prDetailsUrl = context.payload.issue.pull_request.url;
4346 const { data: pull } = await github.request(prDetailsUrl);
@@ -83,17 +86,18 @@ jobs:
8386 if : >
8487 github.event.issue.pull_request &&
8588 github.event.issue.state != 'closed' &&
86- github.actor != 'asyncapi-bot' &&
89+ github.event.comment.user.login != 'asyncapi-bot' &&
8790 (
8891 contains(github.event.comment.body, '/do-not-merge') ||
8992 contains(github.event.comment.body, '/dnm' )
9093 )
9194 runs-on : ubuntu-latest
9295 steps :
9396 - name : Add do-not-merge label
94- uses : actions/github-script@v7
97+ uses : actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
9598 with :
96- github-token : ${{ github.token }}
99+ # Bot PAT so the `labeled` event can trigger downstream workflows.
100+ github-token : ${{ secrets.GH_TOKEN }}
97101 script : |
98102 github.rest.issues.addLabels({
99103 issue_number: context.issue.number,
@@ -109,17 +113,18 @@ jobs:
109113 if : >
110114 github.event.issue.pull_request &&
111115 github.event.issue.state != 'closed' &&
112- github.actor != 'asyncapi-bot' &&
116+ github.event.comment.user.login != 'asyncapi-bot' &&
113117 (
114118 contains(github.event.comment.body, '/autoupdate') ||
115119 contains(github.event.comment.body, '/au' )
116120 )
117121 runs-on : ubuntu-latest
118122 steps :
119123 - name : Add autoupdate label
120- uses : actions/github-script@v7
124+ uses : actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
121125 with :
122- github-token : ${{ github.token }}
126+ # Bot PAT so the `labeled` event can trigger the autoupdate workflow.
127+ github-token : ${{ secrets.GH_TOKEN }}
123128 script : |
124129 github.rest.issues.addLabels({
125130 issue_number: context.issue.number,
0 commit comments