From 195f30d01be9b2b7130e425ac1a1bb797b071796 Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Wed, 25 Sep 2024 08:32:26 -0500 Subject: [PATCH 1/3] 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 1656293..52a0940 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 df7a54d..f7243d4 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-tahoau - 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 From 37441f1bcb15ff10599dcaedf4bcaae38d12f633 Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Thu, 26 Sep 2024 15:45:26 -0500 Subject: [PATCH 2/3] chore: add codeowners file --- .github/CODEOWNERS | 2 ++ .github/workflows/pr_issue_assignment.yml | 24 ----------------------- 2 files changed, 2 insertions(+), 24 deletions(-) create mode 100644 .github/CODEOWNERS delete mode 100644 .github/workflows/pr_issue_assignment.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..0106384 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# The following team is maintainer of this repo +* @eduNEXT/dedalo diff --git a/.github/workflows/pr_issue_assignment.yml b/.github/workflows/pr_issue_assignment.yml deleted file mode 100644 index f7243d4..0000000 --- a/.github/workflows/pr_issue_assignment.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: PR-Issue assignment - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - 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 From 7cd62a703c9c9cbf35edb7b1ce3431f4622e016d Mon Sep 17 00:00:00 2001 From: Bryann Valderrama Date: Thu, 26 Sep 2024 15:45:59 -0500 Subject: [PATCH 3/3] ci: use openedx reusable workflow to add to apollo project --- .../add_issues_prs_to_dedalo_project.yml | 24 ------------------- .github/workflows/add_to_apollo_project.yml | 18 ++++++++++++++ 2 files changed, 18 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/add_issues_prs_to_dedalo_project.yml create mode 100644 .github/workflows/add_to_apollo_project.yml diff --git a/.github/workflows/add_issues_prs_to_dedalo_project.yml b/.github/workflows/add_issues_prs_to_dedalo_project.yml deleted file mode 100644 index 52a0940..0000000 --- a/.github/workflows/add_issues_prs_to_dedalo_project.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Add issues and PRs to the Dedalo project - -on: - issues: - types: [opened] - pull_request: - types: [opened] - -jobs: - add-to-project: - name: Add to project - 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: Add to Dedalo Project - uses: actions/add-to-project@v1.0.2 - with: - project-url: https://github.com/orgs/eduNEXT/projects/1 - github-token: ${{ steps.get_workflow_token.outputs.token }} diff --git a/.github/workflows/add_to_apollo_project.yml b/.github/workflows/add_to_apollo_project.yml new file mode 100644 index 0000000..8c052f3 --- /dev/null +++ b/.github/workflows/add_to_apollo_project.yml @@ -0,0 +1,18 @@ +name: Add issues and PRs to the Apollo project + +on: + issues: + types: [opened] + pull_request: + types: [opened] + +jobs: + add-to-project: + name: Add to Apollo project + uses: openedx/.github/.github/workflows/add-issue-to-a-project.yml@master + secrets: + GITHUB_APP_ID: ${{ vars.APOLLO_APP_ID }} + GITHUB_APP_PRIVATE_KEY: ${{ secrets.APOLLO_APP_SECRET }} + with: + ORGANIZATION: eduNEXT + PROJECT_NUMBER: 1