mirror of
https://github.com/elastic/logstash.git
synced 2025-06-28 01:37:28 -04:00
Create project-board-assigner.yml
This commit is contained in:
parent
fdcaa5dbf5
commit
3f17620194
1 changed files with 76 additions and 0 deletions
76
.github/workflows/project-board-assigner.yml
vendored
Normal file
76
.github/workflows/project-board-assigner.yml
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
name: Add issue to Ingest or Logstash project
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
env:
|
||||
INGEST_PROJECT_ID: 'PVT_kwDOAGc3Zs4AEzn4'
|
||||
LOGSTASH_PROJECT_ID: 'PVT_kwDOAGc3Zs4AMlnl'
|
||||
|
||||
# GitHub labels for each team/area
|
||||
LOGSTASH_LABEL: 'Team:Logstash'
|
||||
DOCS_LABEL: 'Team:Docs'
|
||||
|
||||
# ID values for the Area property + its options for Ingest Board
|
||||
AREA_FIELD_ID: 'PVTSSF_lADOAGc3Zs4AEzn4zgEgZSo'
|
||||
INGEST_DOCS_OPTION_ID: 'def2f8e6'
|
||||
|
||||
jobs:
|
||||
add_to_ingest_project:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: octokit/graphql-action@v2.x
|
||||
id: add_to_ingest_project
|
||||
if: github.event.label.name == env.DOCS_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.PROJECT_TOKEN }}
|
||||
- uses: octokit/graphql-action@v2.x
|
||||
id: add_to_logstash_project
|
||||
if: github.event.label.name == env.LOGSTASH_LABEL
|
||||
with:
|
||||
query: |
|
||||
# Variables have to be snake cased because of https://github.com/octokit/graphql-action/issues/164
|
||||
mutation AddToLogstashProject($project_id: ID!, $content_id: ID!) {
|
||||
addProjectV2ItemById(input: { projectId: $project_id, contentId: $content_id }) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
project_id: ${{ env.LOGSTASH_PROJECT_ID }}
|
||||
content_id: ${{ github.event.issue.node_id }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
||||
# `if` conditions can only be assigned as the "step" level, so there's no way to conditionally pass differing
|
||||
# `areaId` values to our GraphQL mutation. Would be nice if there was support for dictionaries or something in
|
||||
# GH actions to make this a lot more DRY
|
||||
- uses: octokit/graphql-action@v2.x
|
||||
id: set_data_processing_area
|
||||
if: github.event.label.name == env.DOCS_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.INGEST_DOCS_OPTION_ID }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PROJECT_TOKEN }}
|
Loading…
Add table
Add a link
Reference in a new issue