-
Notifications
You must be signed in to change notification settings - Fork 113
51 lines (45 loc) · 1.59 KB
/
submit-to-do-issue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: 'Submit To Do Issue'
on:
workflow_run:
workflows: ["Scan For To Do Comments"]
types:
- completed
permissions: {}
jobs:
submit-todo-issue:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
id: check-user
with:
script: |
await github.rest.repos.checkCollaborator({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.payload.workflow_run.triggering_actor.login
});
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
persist-credentials: false
# Download the artifact from the workflow that kicked off this one.
# The default artifact download action doesn't support cross-workflow
# artifacts, so use a 3rd party one.
- name: 'Download linting results'
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11
with:
workflow: ${{env.workflow_name}}
run_id: ${{github.event.workflow_run.id }}
name: issue-todo
path: ./issue-todo
- name: Submit Issue
run: |
title=$(cat ./issue-todo/issue-title)
user=$(cat ./issue-todo/issue-user)
url=$(cat ./issue-todo/issue-url)
gh issue create --label "todo" --assignee "$user" --title "$title" --body "$url"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}