-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Automation] Add GH action to add issues to ingest board #1629
Merged
+53
−0
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8920c8f
Add GH action to add issues to ingest board
kpollich 0ad69e8
Support Elastic Agent label
kpollich 1dd43b7
Update add-issues-to-ingest-board.yml
kpollich ac1ca2f
Update add-issues-to-ingest-board.yml
kpollich 289caf4
Update add-issues-to-ingest-board.yml
kpollich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Add issue to Platform Ingest project | ||
|
||
on: | ||
issues: | ||
types: | ||
- labeled | ||
|
||
env: | ||
INGEST_PROJECT_ID: 'PVT_kwDOAGc3Zs4AEzn4' | ||
DATA_PLANE_LABEL: 'Team:Elastic-Agent-Data-Plane' | ||
CONTROL_PLANE_LABEL: 'Team:Elastic-Agent-Control-Plane' | ||
ELASTIC_AGENT_LABEL: 'Team:Elastic-Agent' | ||
AREA_FIELD_ID: 'PVTSSF_lADOAGc3Zs4AEzn4zgEgZSo' | ||
ELASTIC_AGENT_OPTION_ID: 'c1e1a30a' | ||
|
||
jobs: | ||
add_to_ingest_project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: octokit/[email protected] | ||
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/[email protected] | ||
id: set_elastic_agent_area | ||
if: github.event.label.name == env.DATA_PLANE_LABEL || github.event.label.name == env.CONTROL_PLANE_LABEL || github.event.label.name == env.ELASTIC_AGENT_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.ELASTIC_AGENT_OPTION_ID }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PROJECT_ASSIGNER_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realizing this token isn't going to exist in this repo. Will generate a new one and update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind I'm lacking permissions to do so. Could someone with admin permissions on this repo help out with a new token that has read/write permissions to projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just granted you admin access to the repo here so you can set this up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I added the proper PAT as a
PROJECT_ASSIGNER_TOKEN
repository secret so this should be good to go.