forked from primer/react
-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (32 loc) · 1.35 KB
/
add_to_inbox.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
name: Move new issues to inbox
on:
issues:
types: [opened, reopened]
jobs:
add-to-inbox:
if: ${{ github.repository == 'primer/react' && (github.event.action == 'opened' || github.event.action == 'reopened') }}
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
ISSUE_ID: ${{ github.event.issue.node_id }}
REACT_LABEL_ID: 'LA_kwDOB0K8ws7Oq_eD'
PROJECT_ID: 'PN_kwDNJr_NNKA'
steps:
- name: Add react label to issue
run: |
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
mutation($reactLabelId: ID!, $issue: ID!) {
addLabelsToLabelable(input: { labelIds: [$reactLabelId], labelableId: $issue }) {
clientMutationId
}
}' -f reactLabelId=$REACT_LABEL_ID -f issue=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id'
- name: Add issue to project
run: |
gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query='
mutation($project:ID!,$issue:ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
projectNextItem {
id
}
}
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id'