Use GitHub Beta API for labeler (#25734)

This commit is contained in:
Malo Marrec 2021-10-06 15:28:13 +02:00 committed by GitHub
parent c3d7170999
commit 176e4d56e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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