From 6eee268a486b5dd794975a93cadc5af45d780a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?= Date: Mon, 7 Feb 2022 10:24:48 +0100 Subject: [PATCH] Fix project auto-assignment closing not merged PRs (#7128) * Fix project assignment on closed PRs not merged * Minor change * Don't execute labeler on closed PRs * Fix column name --- .github/workflows/add-labels-priority.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add-labels-priority.yml b/.github/workflows/add-labels-priority.yml index f865ae3e..8ba2c1f5 100644 --- a/.github/workflows/add-labels-priority.yml +++ b/.github/workflows/add-labels-priority.yml @@ -1,11 +1,12 @@ name: Add Pull Request Labels and Assign to Project on: pull_request_target: - types: [opened] + types: [opened, closed] jobs: triage: runs-on: ubuntu-latest + if: github.event.action == 'opened' steps: - uses: ericcornelissen/labeler@label-based-on-status with: @@ -14,6 +15,7 @@ jobs: assign-to-project: runs-on: ubuntu-latest name: Assign to Project + if: github.event.action == 'opened' needs: triage env: MY_GITHUB_TOKEN: ${{ secrets.AUTO_ASSIGN_WORKFLOW_TOKEN }} @@ -76,3 +78,19 @@ jobs: with: project: https://github.com/orgs/simple-icons/projects/2 column_name: Unprioritised + + unassign-from-project: + runs-on: ubuntu-latest + name: Unassign from Project + if: | + github.event.action != 'opened' && + github.event.pull_request.merged == false + needs: triage + env: + MY_GITHUB_TOKEN: ${{ secrets.AUTO_ASSIGN_WORKFLOW_TOKEN }} + steps: + - name: Assign closed pull requests to "Completed or Abandoned" + uses: srggrs/assign-one-project-github-action@1.3.1 + with: + project: https://github.com/orgs/simple-icons/projects/2 + column_name: Completed or Abandoned