From 176e4d56e17847bb0431d10b331757687ae10cd8 Mon Sep 17 00:00:00 2001 From: Malo Marrec Date: Wed, 6 Oct 2021 15:28:13 +0200 Subject: [PATCH] Use GitHub Beta API for labeler (#25734) --- .github/workflows/label-move.yml | 36 +++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/.github/workflows/label-move.yml b/.github/workflows/label-move.yml index d0818540091..2665581d23a 100644 --- a/.github/workflows/label-move.yml +++ b/.github/workflows/label-move.yml @@ -13,13 +13,6 @@ jobs: column-name: "To Triage" label-name: "team/code-intelligence" columns-to-ignore: "*" - - uses: konradpabjan/move-labeled-or-milestoned-issue@v2.0 - with: - action-token: ${{ secrets.LABELER_GITHUB_TOKEN }} - project-url: "https://github.com/orgs/sourcegraph/projects/216" - column-name: "Triage" - label-name: "team/batchers" - columns-to-ignore: "*" # Uses issues beta API - see https://docs.github.com/en/issues/trying-out-the-new-projects-experience/automating-projects#example-workflow # To get your PROJECT_ID, use: @@ -167,3 +160,32 @@ jobs: } } }' -f project=$PROJECT_ID -f node_id=$NODE_ID + batchers-board: + runs-on: ubuntu-latest + env: + PROJECT_ID: MDExOlByb2plY3ROZXh0NDI1Nw== # https://github.com/orgs/sourcegraph/projects/216 + GITHUB_TOKEN: ${{ secrets.GH_PROJECTS_ACTION_TOKEN }} + steps: + - name: Get issue if relevant + if: ${{ contains(github.event.issue.labels.*.name, 'team/batchers') }} + 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/batchers') }} + env: + NODE_ID: ${{ github.event.pull_request.node_id }} + run: echo 'NODE_ID='$NODE_ID >> $GITHUB_ENV + - name: Add to Batchers 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 + +