mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Fleet] Update GH Projects automation (#144123)
* [Fleet] Update GH Projects automation Update GH projects automation for issues labeled with `Team:Fleet` to be automatically added to the Ingest Dev project with the proper `Area` property set. * Update add-to-fleet-project.yml * Rename add-to-fleet-project.yml to add-fleet-issues-to-ingest-project.yml
This commit is contained in:
parent
a5c8ebe00d
commit
1831ebf0bb
2 changed files with 51 additions and 36 deletions
51
.github/workflows/add-fleet-issues-to-ingest-project.yml
vendored
Normal file
51
.github/workflows/add-fleet-issues-to-ingest-project.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
name: Add Fleet issue to Platform Ingest project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
env:
|
||||
INGEST_PROJECT_ID: 'PVT_kwDOAGc3Zs4AEzn4'
|
||||
FLEET_LABEL: 'Team:Fleet'
|
||||
AREA_FIELD_ID: 'PVTSSF_lADOAGc3Zs4AEzn4zgEgZSo'
|
||||
FLEET_UI_OPTION_ID: '411a7b86'
|
||||
|
||||
jobs:
|
||||
add_to_ingest_project:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: octokit/graphql-action@v2.x
|
||||
id: add_to_project
|
||||
if: ${{ github.event.label.name == env.FLEET_LABEL }}
|
||||
with:
|
||||
query: |
|
||||
# Variables have to be snake cased because of https://github.com/octokit/graphql-action/issues/164
|
||||
mutation AddToIngestProject($project_id: ID!, $content_id: ID!) {
|
||||
addProjectV2ItemById(input: { projectId: $project_id, contentId: $content_id }) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
project_id: ${{ env.INGEST_PROJECT_ID }}
|
||||
content_id: ${{ github.event.issue.node_id }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}
|
||||
- uses: octokit/graphql-action@v2.x
|
||||
id: set_fleet_ui_area
|
||||
if: github.event.label.name == env.FLEET_LABEL
|
||||
with:
|
||||
query: |
|
||||
mutation updateIngestArea($item_id: ID!, $project_id: ID!, $area_field_id: ID!, $area_id: String) {
|
||||
updateProjectV2ItemFieldValue(
|
||||
input: { itemId: $item_id, projectId: $project_id, fieldId: $area_field_id, value: { singleSelectOptionId: $area_id } }) {
|
||||
clientMutationId
|
||||
}
|
||||
}
|
||||
item_id: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectV2ItemById.item.id }}
|
||||
project_id: ${{ env.INGEST_PROJECT_ID }}
|
||||
area_field_id: ${{ env.AREA_FIELD_ID }}
|
||||
area_id: ${{ env.FLEET_UI_OPTION_ID }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}
|
36
.github/workflows/add-to-fleet-project.yml
vendored
36
.github/workflows/add-to-fleet-project.yml
vendored
|
@ -1,36 +0,0 @@
|
|||
name: Add to Fleet:Quality project
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
jobs:
|
||||
add_to_project:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
contains(github.event.issue.labels.*.name, 'Team:Fleet') && (
|
||||
contains(github.event.issue.labels.*.name, 'technical debt') ||
|
||||
contains(github.event.issue.labels.*.name, 'bug') ||
|
||||
contains(github.event.issue.labels.*.name, 'performance') ||
|
||||
contains(github.event.issue.labels.*.name, 'failed-test') ||
|
||||
contains(github.event.issue.labels.*.name, 'chore')
|
||||
)
|
||||
steps:
|
||||
- uses: octokit/graphql-action@v2.x
|
||||
id: add_to_project
|
||||
with:
|
||||
headers: '{"GraphQL-Features": "projects_next_graphql"}'
|
||||
query: |
|
||||
mutation add_to_project($projectid: ID!, $contentid: ID!) {
|
||||
addProjectNextItem(input:{projectId:$projectid contentId:$contentid}) {
|
||||
projectNextItem {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
projectid: ${{ env.PROJECT_ID }}
|
||||
contentid: ${{ github.event.issue.node_id }}
|
||||
env:
|
||||
# https://github.com/orgs/elastic/projects/763
|
||||
PROJECT_ID: "PN_kwDOAGc3Zs4AAsH6"
|
||||
# Token with `write:org` access
|
||||
GITHUB_TOKEN: ${{ secrets.FLEET_TECH_KIBANA_USER_TOKEN }}
|
Loading…
Add table
Add a link
Reference in a new issue