File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 3030 id-token : write # Required for GCP authentication
3131
3232 steps :
33+ - name : Check commenter permissions
34+ if : github.event_name == 'issue_comment'
35+ uses : actions/github-script@v7
36+ with :
37+ script : |
38+ const { data: permission } = await github.rest.repos.getCollaboratorPermissionLevel({
39+ owner: context.repo.owner,
40+ repo: context.repo.repo,
41+ username: context.actor
42+ });
43+ if (!['admin', 'write'].includes(permission.permission)) {
44+ core.setFailed('Only collaborators with write access can trigger this workflow');
45+ }
46+ console.log(`User ${context.actor} has ${permission.permission} permission`);
47+
3348 - name : Get PR details (for comment trigger)
3449 if : github.event_name == 'issue_comment'
3550 id : pr
5267 token : ${{ github.token }}
5368
5469 - name : Install uv
55- uses : astral-sh/setup-uv@v4
70+ uses : astral-sh/setup-uv@e4db8464a088ece1b920f60402e813ea4de65b8f # v4
5671
5772 - name : Set up Python
5873 uses : actions/setup-python@v5.2.0
You can’t perform that action at this time.
0 commit comments