Skip to content

Commit f94d60e

Browse files
authored
Fix missing checks:write permission (#76)
Signed-off-by: Derek Misler <derek.misler@docker.com>
1 parent 68c6c67 commit f94d60e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/review-pr.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ permissions:
100100
contents: read
101101
pull-requests: write
102102
issues: write
103-
checks: write
103+
# checks: write is intentionally omitted — callers can grant it optionally
104+
# for the "PR Review" check run on the PR. The check creation steps use
105+
# continue-on-error so the review works fine without it.
104106

105107
jobs:
106108
# ==========================================================================
@@ -219,13 +221,15 @@ jobs:
219221
repo: context.repo.repo,
220222
pull_number: prNumber
221223
});
224+
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
222225
const { data: check } = await github.rest.checks.create({
223226
owner: context.repo.owner,
224227
repo: context.repo.repo,
225228
name: 'PR Review',
226229
head_sha: pr.head.sha,
227230
status: 'in_progress',
228-
started_at: new Date().toISOString()
231+
started_at: new Date().toISOString(),
232+
details_url: runUrl
229233
});
230234
core.setOutput('check-id', check.id);
231235

.github/workflows/self-review-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ jobs:
124124
repo: context.repo.repo,
125125
pull_number: prNumber
126126
});
127+
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
127128
const { data: check } = await github.rest.checks.create({
128129
owner: context.repo.owner,
129130
repo: context.repo.repo,
130131
name: 'PR Review',
131132
head_sha: pr.head.sha,
132133
status: 'in_progress',
133-
started_at: new Date().toISOString()
134+
started_at: new Date().toISOString(),
135+
details_url: runUrl
134136
});
135137
core.setOutput('check-id', check.id);
136138

0 commit comments

Comments
 (0)