From 6b50179c89a8ea78b5050c1d1df21843326ec125 Mon Sep 17 00:00:00 2001 From: KTrain5369 <69028025+KTrain5169@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:18:53 +1000 Subject: [PATCH] chore: actions-related fixups workflows/prettier.yml: * Only runs on opening, reopening, ready for review, and commits to head when dealing with PRs workflows/pr_management.yml: * Assigning PR author now also happens on reopen * Labelling PRs will now only trigger if the event wasn't adding labels, preventing the workflow from running a second, unintended time. * Assign/unassign reviewers will now run only if the PR is marked as ready for review * Set run-name to "PR management stuff" labels.yml: * Incorrect grammar lol --- .github/labels.yml | 2 +- .github/workflows/pr_management.yml | 12 ++++++++---- .github/workflows/prettier.yml | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index b56bbcd..310a5ea 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -13,4 +13,4 @@ labels: - body: "- [x] Tick this box if you made changes that may or may not break site functionality." - name: "Merge conflict identified" conditions: - - mergable: false + - mergeable: false diff --git a/.github/workflows/pr_management.yml b/.github/workflows/pr_management.yml index 9c0957b..c31a66b 100644 --- a/.github/workflows/pr_management.yml +++ b/.github/workflows/pr_management.yml @@ -1,28 +1,32 @@ name: Auto Label PRs, then add assignees and reviewers automatically. +run-name: PR management stuff + on: pull_request_target: - types: [opened, reopened, edited, synchronize] + types: [opened, reopened, edited, synchronize, labeled] jobs: add_labels_reviewers_assignees: - name: Add labels, then reviewers & assignees + name: Add labels, reviewers & assignees runs-on: ubuntu-latest steps: - name: Auto-assign PR author as assignee - if: github.event.action == 'opened' + if: github.event.action == 'opened' || github.event.action == 'reopened' id: author-assignee uses: itsOliverBott/assign-pr-author-as-assignee@release with: token: ${{ secrets.GITHUB_TOKEN }} - name: Label PR based on content + if: github.event.action != 'labeled' id: label-pr uses: prulloac/configurable-pr-labeler@v1.1.2 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Assign/unassign reviewers + if: github.event.action == 'ready_for_review' id: assign-reviewers uses: totallymoney/assign-reviewers-by-labels-action@v1.2.0 with: @@ -54,7 +58,7 @@ jobs: - name: Assigned/unassigned reviewers failure(?) debug log if: steps.assign-reviewers.outputs.assigned_status == 'info' && steps.assign_reviewers.outputs.unassigned_status == 'info' run: | - echo "Uh-oh! I ran into an issue when assigning/unassigning reviewers! Here's some info: \n" + echo "Uh-oh! I probably ran into an issue when assigning/unassigning reviewers! Here's some info: \n" echo "PR I attempted to assign reviewers to: ${{ steps.assign_reviewers.outputs.assigned_url }}" echo "Commit SHA: ${{ github.sha }}" diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 8a457ec..d4b2269 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -3,6 +3,7 @@ name: "Prettier" on: push: pull_request: + types: [opened, reopened, ready_for_review, synchronize] jobs: prettier-check: