github.com/waldiirawan/apm-agent-go/v2@v2.2.2/.github/workflows/addToAPMProject.yml (about)

     1  name: Add to APM Project
     2  on:
     3    issues:
     4      types:
     5        - opened
     6  jobs:
     7    add_to_project:
     8      runs-on: ubuntu-latest
     9      name: Assign issues to APM Project for the Server Team
    10      steps:
    11        - uses: octokit/graphql-action@v2.x
    12          id: add_to_project
    13          with:
    14            query: |
    15              mutation add_to_project($projectid:ID!,$contentid:ID!) {
    16                addProjectV2ItemById(input:{projectId:$projectid contentId:$contentid}) {
    17                  item {
    18                    ... on ProjectV2Item {
    19                      id
    20                    }
    21                  }
    22                }
    23              }
    24            projectid: ${{ env.PROJECT_ID }}
    25            contentid: ${{ github.event.issue.node_id }}
    26          env:
    27            PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
    28            GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
    29        - uses: octokit/graphql-action@v2.x
    30          id: label_team
    31          with:
    32            query: |
    33              mutation label_team($projectid:ID!,$itemid:ID!,$fieldid:ID!,$value:String!) {
    34                updateProjectV2ItemFieldValue(input: { projectId:$projectid itemId:$itemid fieldId:$fieldid value:{singleSelectOptionId: $value} }) {
    35                  projectV2Item {
    36                    id
    37                    content {
    38                      ... on Issue {
    39                        number
    40                      }
    41                    }
    42                  }
    43                }
    44              }
    45            projectid: ${{ env.PROJECT_ID }}
    46            itemid: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectV2ItemById.item.id }}
    47            fieldid: "PVTSSF_lADOAGc3Zs0VSs2scg"
    48            value: "6c538d8a"
    49          env:
    50            PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
    51            GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}