From 8666ccfe978c73577626492a9a5dadce92b7274b Mon Sep 17 00:00:00 2001 From: Murat Sutunc Date: Tue, 28 Sep 2021 10:34:23 -0700 Subject: [PATCH] migrate label automation for extensibility This change migrates the label automation from using the old board to the beta board --- .github/workflows/label-move.yml | 34 +++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/label-move.yml b/.github/workflows/label-move.yml index a2d8a3a3b2c..00a76286597 100644 --- a/.github/workflows/label-move.yml +++ b/.github/workflows/label-move.yml @@ -6,13 +6,6 @@ jobs: move-labeled-or-milestoned-issue: runs-on: ubuntu-latest steps: - - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0 - with: - action-token: "${{ secrets.LABELER_GITHUB_TOKEN }}" - project-url: "https://github.com/orgs/sourcegraph/projects/145" - column-name: "To Triage 📥" - label-name: "team/extensibility" - columns-to-ignore: "*" - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0 with: action-token: "${{ secrets.LABELER_GITHUB_TOKEN }}" @@ -147,3 +140,30 @@ jobs: } } }' -f project=$PROJECT_ID -f node_id=$NODE_ID + extensibility-board: + runs-on: ubuntu-latest + env: + PROJECT_ID: MDExOlByb2plY3ROZXh0NDMyNg== # https://github.com/orgs/sourcegraph/projects/213 + GITHUB_TOKEN: ${{ secrets.GH_PROJECTS_ACTION_TOKEN }} + steps: + - name: Get issue if relevant + if: ${{ contains(github.event.issue.labels.*.name, 'team/extensibility') }} + env: + NODE_ID: ${{ github.event.issue.node_id }} + run: echo 'NODE_ID='$NODE_ID >> $GITHUB_ENV + - name: Get pull request if relevant + if: ${{ contains(github.event.pull_request.labels.*.name, 'team/extensibility') }} + env: + NODE_ID: ${{ github.event.pull_request.node_id }} + run: echo 'NODE_ID='$NODE_ID >> $GITHUB_ENV + - name: Add to Extensibility board + if: ${{ env.NODE_ID != '' }} + run: | + gh api graphql --header 'GraphQL-Features: projects_next_graphql' -f query=' + mutation($project:ID!, $node_id:ID!) { + addProjectNextItem(input: {projectId: $project, contentId: $node_id}) { + projectNextItem { + id + } + } + }' -f project=$PROJECT_ID -f node_id=$NODE_ID