Skip to content

Commit facac84

Browse files
subatoiCopilot
andauthored
Adds workflow for assigning DIY docs PR/issues openers to their creators (#57995)
Co-authored-by: Copilot <[email protected]>
1 parent cb0d3cc commit facac84

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Assign DIY docs issues
2+
3+
on:
4+
issues:
5+
types: labeled
6+
workflow_call:
7+
8+
permissions:
9+
contents: read
10+
jobs:
11+
assign_diy_docs_issues:
12+
name: Assign issues labelled with "DIY docs" to the issue creator
13+
if: >-
14+
github.repository_owner == 'github' && github.repository != 'github/docs' &&
15+
github.event.label.name == 'DIY docs'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Assign to creator
19+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
20+
with:
21+
script: |
22+
const item = context.payload.issue;
23+
const creator = item.user.login;
24+
const issueNumber = item.number;
25+
await github.rest.issues.addAssignees({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
issue_number: issueNumber,
29+
assignees: [creator]
30+
});

0 commit comments

Comments
 (0)