Skip to content

Commit e118576

Browse files
fix: resolve #355 - PR Agent 无权限校验,存在密钥泄露与滥用风险
1 parent 6cd6fd6 commit e118576

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/pr-agent.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,27 @@ on:
55
issue_comment:
66
jobs:
77
pr_agent_job:
8-
if: ${{ github.event.sender.type != 'Bot' }}
8+
if: >-
9+
${{
10+
github.event.sender.type != 'Bot' &&
11+
(
12+
(
13+
github.event_name == 'pull_request' &&
14+
contains(
15+
fromJSON('["OWNER","MEMBER","COLLABORATOR"]'),
16+
github.event.pull_request.author_association
17+
)
18+
) ||
19+
(
20+
github.event_name == 'issue_comment' &&
21+
github.event.issue.pull_request &&
22+
contains(
23+
fromJSON('["OWNER","MEMBER","COLLABORATOR"]'),
24+
github.event.comment.author_association
25+
)
26+
)
27+
)
28+
}}
929
runs-on: ubuntu-latest
1030
permissions:
1131
issues: write

0 commit comments

Comments
 (0)