Skip to content

Submit To Do Issue #2473

Submit To Do Issue

Submit To Do Issue #2473

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@80620a5d27ce0ae443b965134db88467fc607b43
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 }}