diff --git a/.github/workflows/elastic-agent-pull-requests.yml b/.github/workflows/elastic-agent-pull-requests.yml new file mode 100644 index 00000000000..55c56614957 --- /dev/null +++ b/.github/workflows/elastic-agent-pull-requests.yml @@ -0,0 +1,44 @@ +name: Add to Elastic Agent Data Plane or Control Plane Board +on: + pull_request: + types: + - labeled +jobs: + add_to_data_plane-project: + runs-on: ubuntu-latest + if: | + github.event.label.name == 'Team:Elastic-Agent-Data-Plane' + steps: + - uses: octokit/graphql-action@v2.x + id: add_to_project + with: + query: | + mutation add_to_project($projectid:String!,$contentid:String!) { + updatePullRequest(input: {pullRequestId:$contentid, projectIds:$projectid}) { + clientMutationId + } + } + projectid: ${{ env.PROJECT_ID }} + contentid: ${{ github.event.pull_request.node_id }} + env: + PROJECT_ID: "PRO_kwDOAGc3Zs4AzG8z" + GITHUB_TOKEN: ${{ secrets.ELASTIC_AGENT_PROJECT_BOARD_TOKEN }} + add_to_control_plane-project: + runs-on: ubuntu-latest + if: | + github.event.label.name == 'Team:Elastic-Agent-Control-Plane' + steps: + - uses: octokit/graphql-action@v2.x + id: add_to_project + with: + query: | + mutation add_to_project($projectid:String!,$contentid:String!) { + updatePullRequest(input: {pullRequestId:$contentid, projectIds:$projectid}) { + clientMutationId + } + } + projectid: ${{ env.PROJECT_ID }} + contentid: ${{ github.event.pull_request.node_id }} + env: + PROJECT_ID: "PRO_kwDOAGc3Zs4AzG9E" + GITHUB_TOKEN: ${{ secrets.ELASTIC_AGENT_PROJECT_BOARD_TOKEN }}