Adds workflow for assigning DIY docs PR/issues openers to their creators (#57995)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
30
.github/workflows/assign-diy-docs.yml
vendored
Normal file
30
.github/workflows/assign-diy-docs.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
name: Assign DIY docs issues
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: labeled
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
assign_diy_docs_issues:
|
||||||
|
name: Assign issues labelled with "DIY docs" to the issue creator
|
||||||
|
if: >-
|
||||||
|
github.repository_owner == 'github' && github.repository != 'github/docs' &&
|
||||||
|
github.event.label.name == 'DIY docs'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Assign to creator
|
||||||
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const item = context.payload.issue;
|
||||||
|
const creator = item.user.login;
|
||||||
|
const issueNumber = item.number;
|
||||||
|
await github.rest.issues.addAssignees({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issueNumber,
|
||||||
|
assignees: [creator]
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user