Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: actions-related fixups
Browse files Browse the repository at this point in the history
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
KTrain5169 committed Jul 14, 2024
1 parent 6c28d06 commit 6b50179
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions .github/workflows/pr_management.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
1 change: 1 addition & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ name: "Prettier"
on:
push:
pull_request:
types: [opened, reopened, ready_for_review, synchronize]

jobs:
prettier-check:

0 comments on commit 6b50179

Please sign in to comment.