File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Add Contributors Label
2+
3+ on :
4+ # issues:
5+ # types: [opened]
6+
7+ pull_request_target :
8+ types : [opened]
9+
10+ jobs :
11+ add-contributor-label :
12+ runs-on : ubuntu-latest
13+ permissions :
14+ pull-requests : write
15+ issues : write
16+
17+ steps :
18+ - name : Add Contributor Label
19+ uses : actions/github-script@v8
20+ with :
21+ script : |
22+ const isPR = !!context.payload.pull_request;
23+ const issueNumber = isPR ? context.payload.pull_request.number : context.payload.issue.number;
24+ const authorAssociation = isPR ? context.payload.pull_request.author_association : context.payload.issue.author_association;
25+
26+ if (authorAssociation === 'CONTRIBUTOR') {
27+ await github.rest.issues.addLabels({
28+ owner: context.repo.owner,
29+ repo: context.repo.repo,
30+ issue_number: issueNumber,
31+ labels: ['contributor']
32+ });
33+ }
You can’t perform that action at this time.
0 commit comments