From e1646f7578610a11c1029e19f094f6065b234b1f Mon Sep 17 00:00:00 2001 From: Desi McAdam Date: Thu, 21 Nov 2024 08:31:31 -0700 Subject: [PATCH 1/2] Fix to capture codeowner plus ability to run on existing PRs --- .github/workflows/add-prs-to-project.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add-prs-to-project.yml b/.github/workflows/add-prs-to-project.yml index f930f9a370..b5bfbfc679 100644 --- a/.github/workflows/add-prs-to-project.yml +++ b/.github/workflows/add-prs-to-project.yml @@ -2,6 +2,11 @@ name: 'Add PR to Project Board - Wallet Framework Team' on: workflow_dispatch: + inputs: + scan_existing_prs: + description: 'Scan existing open PRs' + type: boolean + default: false pull_request: types: [opened, labeled, review_requested] @@ -14,11 +19,25 @@ jobs: TEAM_LABEL: 'team-wallet-framework' steps: + - name: Get existing PRs + if: github.event.inputs.scan_existing_prs == 'true' + id: get-prs + uses: actions/github-script@v6 + with: + script: | + const prs = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + }); + return prs.data; + - name: Add PR to project board uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e if: | github.event.requested_team.name == env.TEAM_NAME || - contains(github.event.pull_request.labels.*.name, env.TEAM_LABEL) + contains(github.event.pull_request.labels.*.name, env.TEAM_LABEL) || + contains(github.event.pull_request.requested_teams.*.name, env.TEAM_NAME) with: project-url: https://github.com/orgs/MetaMask/projects/113 github-token: ${{ secrets.CORE_ADD_PRS_TO_PROJECT }} From 0b00680bde87068419157ea57ba33e7a012c085d Mon Sep 17 00:00:00 2001 From: Desi McAdam Date: Thu, 21 Nov 2024 16:40:13 -0700 Subject: [PATCH 2/2] Abort running against existing PRs - The code felt overly complicated to add to the action --- .github/workflows/add-prs-to-project.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/add-prs-to-project.yml b/.github/workflows/add-prs-to-project.yml index b5bfbfc679..b3f2a5bf9d 100644 --- a/.github/workflows/add-prs-to-project.yml +++ b/.github/workflows/add-prs-to-project.yml @@ -1,12 +1,6 @@ name: 'Add PR to Project Board - Wallet Framework Team' on: - workflow_dispatch: - inputs: - scan_existing_prs: - description: 'Scan existing open PRs' - type: boolean - default: false pull_request: types: [opened, labeled, review_requested] @@ -19,19 +13,6 @@ jobs: TEAM_LABEL: 'team-wallet-framework' steps: - - name: Get existing PRs - if: github.event.inputs.scan_existing_prs == 'true' - id: get-prs - uses: actions/github-script@v6 - with: - script: | - const prs = await github.rest.pulls.list({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - return prs.data; - - name: Add PR to project board uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e if: |