From 415bce76b80e418365aee1499ab9dcb941458a8f Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Wed, 25 Sep 2024 07:08:22 -0500 Subject: [PATCH] ci: use github application instead of pat in workflows --- .../add_issues_prs_to_dedalo_project.yml | 11 +++++-- .github/workflows/pr_issue_assignment.yml | 32 +++++++++++-------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/add_issues_prs_to_dedalo_project.yml b/.github/workflows/add_issues_prs_to_dedalo_project.yml index 16562939..52a0940f 100644 --- a/.github/workflows/add_issues_prs_to_dedalo_project.yml +++ b/.github/workflows/add_issues_prs_to_dedalo_project.yml @@ -11,7 +11,14 @@ jobs: name: Add to project runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@v1.0.1 + - name: Get Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v3 + with: + application_id: ${{ vars.APOLLO_APP_ID }} + application_private_key: ${{ secrets.APOLLO_APP_SECRET }} + - name: Add to Dedalo Project + uses: actions/add-to-project@v1.0.2 with: project-url: https://github.com/orgs/eduNEXT/projects/1 - github-token: ${{ secrets.DEDALO_PAT }} + github-token: ${{ steps.get_workflow_token.outputs.token }} diff --git a/.github/workflows/pr_issue_assignment.yml b/.github/workflows/pr_issue_assignment.yml index 7704d907..f7243d48 100644 --- a/.github/workflows/pr_issue_assignment.yml +++ b/.github/workflows/pr_issue_assignment.yml @@ -1,18 +1,24 @@ name: PR-Issue assignment on: - issues: - types: [opened] - pull_request: - types: [opened] + issues: + types: [opened] + pull_request: + types: [opened] jobs: - auto-assign: - runs-on: ubuntu-latest - steps: - - name: 'Auto-assign PR-Issue' - uses: pozil/auto-assign-issue@v2 - with: - repo-token: ${{ secrets.DEDALO_PAT }} - teams: django-plugins-teco - numOfAssignee: 2 + auto-assign: + name: Auto Assign + runs-on: ubuntu-latest + steps: + - name: Get Token + id: get_workflow_token + uses: peter-murray/workflow-application-token-action@v3 + with: + application_id: ${{ vars.APOLLO_APP_ID }} + application_private_key: ${{ secrets.APOLLO_APP_SECRET }} + - name: Auto-assign PR-Issue + uses: pozil/auto-assign-issue@v2 + with: + repo-token: ${{ steps.get_workflow_token.outputs.token }} + teams: dedalo