cli/.github/workflows/discussion-triage.yml
William Martin 4213e3e2b4 Update secret name to not be prefixed with GITHUB
Apparently this isn't allowed
2023-10-31 09:49:46 +01:00

32 lines
1.2 KiB
YAML

name: Discussion Triage
run-name: ${{ github.event.issue.title }}
on:
issues:
types:
- labeled
jobs:
create-discussion:
if: github.event.label.name == 'discuss'
runs-on: ubuntu-latest
steps:
- name: Create a discussion in github/cli
run: |
export DISCUSSION_TITLE="Triage: ${ISSUE_TITLE} (#${ISSUE_NUMBER})"
gh api graphql -f query='
mutation($repositoryId: String!, $categoryId: String!, $title: String!, $body: String!) {
createDiscussion(
input: {repositoryId: $repositoryId, categoryId: $categoryId, title: $title, body: $body}
) {
discussion {
id
}
}
}' -f title="${DISCUSSION_TITLE}" -f body="@${LABELLER} added the discuss label to #${ISSUE_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.CLI_DISCUSSION_TRIAGE_TOKEN }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
LABELLER: ${{ github.event.sender.login }}
GITHUB_CLI_REPOSITORY_ID: "R_kgDODAqwpw"
TRIAGE_CATEGORY_ID: "DIC_kwDODAqwp84CajJa"