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