From e06ecd893da5fdfbf85684c0bfe910e8c65d18bc Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Oct 2024 14:22:02 +0200 Subject: [PATCH] github-actions: use GH app to manage the projects --- .github/workflows/addToAPMProject.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/addToAPMProject.yml b/.github/workflows/addToAPMProject.yml index 1d6132339..d6225a5cb 100644 --- a/.github/workflows/addToAPMProject.yml +++ b/.github/workflows/addToAPMProject.yml @@ -11,6 +11,16 @@ jobs: runs-on: ubuntu-latest name: Assign issues to APM Project for the Server Team steps: + - name: Get token + id: get_token + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 + with: + app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }} + private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }} + permissions: >- + { + "repository_projects": "write" + } - uses: octokit/graphql-action@v2.x id: add_to_project with: @@ -28,7 +38,7 @@ jobs: contentid: ${{ github.event.issue.node_id }} env: PROJECT_ID: "PVT_kwDOAGc3Zs0VSg" - GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }} + GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} - uses: octokit/graphql-action@v2.x id: label_team with: @@ -51,4 +61,4 @@ jobs: value: "6c538d8a" env: PROJECT_ID: "PVT_kwDOAGc3Zs0VSg" - GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }} + GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}