Skip to content

Commit 3cd870f

Browse files
committed
ci: add project issue sync action for new issues
adds new github action to link new issues to the kibana vis team project
1 parent 1afa2c4 commit 3cd870f

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/new_issue_sync.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Sync new issues to Vis Team project
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
add_new_issue_to_project:
9+
runs-on: ubuntu-latest
10+
name: Add new issue to project
11+
if: github.event.action == 'opened'
12+
steps:
13+
- name: Add issue
14+
uses: octokit/[email protected]
15+
id: add_issue
16+
with:
17+
query: |
18+
mutation addProjectItem($project_id: ID!, $content_id: ID!) {
19+
addProjectV2ItemById(input: { projectId: $project_id, contentId: $content_id }) {
20+
item {
21+
id
22+
}
23+
}
24+
}
25+
project_id: ${{ vars.VIS_TEAM_PROJECT_ID }}
26+
content_id: ${{ github.event.issue.node_id }}
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN_GH }}
29+
30+
- name: Set issue status to New
31+
uses: octokit/[email protected]
32+
id: update_issue
33+
with:
34+
query: |
35+
mutation updateProjectItem($project_id: ID!, $item_id: ID!, $field_id: ID!, $option_id: String!) {
36+
updateProjectV2ItemFieldValue(
37+
input: { projectId: $project_id, itemId: $item_id, fieldId: $field_id, value: { singleSelectOptionId: $option_id } }
38+
) {
39+
clientMutationId
40+
}
41+
}
42+
item_id: ${{ fromJSON(steps.add_issue.outputs.data).addProjectV2ItemById.item.id }}
43+
project_id: ${{ vars.VIS_TEAM_PROJECT_ID }}
44+
field_id: ${{ vars.STATUS_PROJECT_FIELD_ID }}
45+
option_id: ${{ vars.NEW_PROJECT_ITEM_OPTION_ID }}
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN_GH }}

0 commit comments

Comments
 (0)