-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
does this count as breaking? I'm not sure anymore
- Loading branch information
1 parent
e8575b5
commit 2a38abd
Showing
7 changed files
with
124 additions
and
135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Pull request template | ||
|
||
## Category | ||
|
||
<!-- Make sure the marked category is correct! This is important as your pull request will automatically label your PR and request reviewers!--> | ||
|
||
- [ ] Add mod to alternatives page | ||
- [ ] Site changes | ||
- [ ] Chore/documentation updates | ||
|
||
## Describe changes | ||
|
||
<!-- Describe your changes --> | ||
|
||
## Why did you do this? | ||
|
||
<!-- If you added a mod to alternatives page, why did you add that mod? --> | ||
<!-- If you made some changes to the site, why and how would this effect the current site? --> | ||
<!-- If you did chore/documentation updates, why so and how will this help? --> | ||
|
||
## BREAKING CHANGES | ||
|
||
- [ ] Tick this box if you made changes that may or may not break site functionality. | ||
|
||
<!-- List breaking changes above this line and why this is necessary. --> | ||
|
||
## What issues (if any) would this resolve? | ||
|
||
Resolves #x | ||
|
||
<!-- add more above if necessary --> | ||
|
||
## Checklist | ||
|
||
<!-- For adding mods to the alternatives page --> | ||
|
||
- [ ] I have put clear & concise details about the mod onto the page. | ||
- [ ] The link I have put in is a valid link. | ||
- [ ] This mod is not a RAT. | ||
- [ ] I have searched for duplicate pull requests and have not found any. | ||
|
||
<!-- For site changes --> | ||
|
||
- [ ] I have clearly stated why I want this to be changed. | ||
- [ ] For major changes, I have clearly stated what they are and why I've done them. | ||
- [ ] I have searched for duplicate pull requests and have not found any. | ||
|
||
<!-- For chore/doc updates --> | ||
|
||
- [ ] I have clearly explained why I have done this. | ||
- [ ] I have searched for duplicate pull requests and have not found any. | ||
|
||
<!-- For all --> | ||
|
||
- [ ] I did not read this section. | ||
|
||
Vercel will begin deploying to the Preview environment shortly after submitting this pull request (unless your only modified directories are listed in `.vercelignore`). You may click on the "Visit Preview" link below to see a preview of what your changes look like. | ||
You may also use the StackBlitz Codeflow button to view the PR in the browser and make changes at the same time if necessary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
assign: | ||
add mod: ["KTrain5169", "blryface"] | ||
enhancement: ["WorldWidePixel", "Nitrrine"] | ||
documentation: ["blryface", "KTrain5169", "WorldWidePixel"] | ||
all maintainers required: | ||
["blryface", "WorldWidePixel", "Nitrrine", "KTrain5169"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
labels: | ||
- name: "add mod" | ||
conditions: | ||
- body: "- [x] Add mod to alternatives page" | ||
- name: "enhancement" | ||
conditions: | ||
- body: "- [x] Site changes" | ||
- name: "documentation" | ||
conditions: | ||
- body: "- [x] Chore/documentation updates" | ||
- name: "BREAKING CHANGE" | ||
conditions: | ||
- body: "- [x] Tick this box if you made changes that may or may not break site functionality." | ||
- name: "Merge conflict identified" | ||
conditions: | ||
- mergable: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,65 @@ | ||
name: Auto Label PRs, then add assignees and reviewers automatically. | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
pull_request_target: | ||
types: [opened, reopened, edited, synchronize] | ||
|
||
jobs: | ||
add_labels_reviewers_assignees: | ||
name: Add labels, then reviewers & assignees | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Auto-assign PR author as assignee | ||
if: github.event.action == 'opened' | ||
id: author-assignee | ||
uses: itsOliverBott/assign-pr-author-as-assignee@release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Label PR based on content | ||
id: label-pr | ||
uses: actions/github-script@v7 | ||
uses: prulloac/[email protected] | ||
with: | ||
script: | | ||
const labels = { | ||
'alternative addition template': 'add mod', | ||
'site changes template': 'enhancement', | ||
'chore/documentation template': 'documentation' | ||
}; | ||
const body = context.payload.pull_request.body.toLowerCase(); | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
const foundLabels = Object.entries(labels) | ||
.filter(([keyword]) => body.includes(keyword)) | ||
.map(([, label]) => label); | ||
if (foundLabels.length > 0) { | ||
await github.issues.addLabels({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
labels: foundLabels | ||
}); | ||
} | ||
return { labels: foundLabels }; | ||
- name: Assign/unassign reviewers | ||
id: assign-reviewers | ||
uses: totallymoney/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
unassign-if-label-removed: true | ||
|
||
- name: Set Reviewers and Assignees | ||
if: steps.label-pr.outputs.labels != '[]' | ||
uses: actions/github-script@v7 | ||
- name: Comment on PRs | ||
uses: dannyskoog/pull-request-comment@v1 | ||
if: steps.assign-reviewers.outputs.assigned_status == 'success' && steps.assign_reviewers.outputs.unassigned_status == 'success' | ||
with: | ||
script: | | ||
const labelToReviewers = { | ||
'add mod': ['KTrain5169', 'blryface'], | ||
'enhancement': ['WorldWidePixel', 'Nitrrine'], | ||
'documentation': ['blryface', 'KTrain5169', 'WorldWidePixel'] | ||
}; | ||
message: I've labeled your PR, assigned you and requested/un-requested reviews from the relevant people automatically. If you think I did it wrong, please comment below so one of our maintainers can double-check. Thanks! | ||
|
||
const labels = JSON.parse('${{ steps.label-pr.outputs.labels }}').labels; | ||
const reviewers = new Set(); | ||
- name: Assigned/unassigned reviewers success debug log | ||
if: steps.assign-reviewers.outputs.assigned_status == 'success' && steps.assign_reviewers.outputs.unassigned_status == 'success' | ||
run: | | ||
echo "Successfully assigned/unassigned reviewers! Printing more info below..." | ||
echo "If values return null, that means I didn't do anything.\n" | ||
labels.forEach(label => { | ||
(labelToReviewers[label] || []).forEach(reviewer => reviewers.add(reviewer)); | ||
}); | ||
echo "PR I assigned reviewers to: ${{ steps.assign_reviewers.outputs.assigned_url }}" | ||
echo "Commit SHA: ${{ github.sha }}" | ||
echo "I assigned: ${{ steps.reviewer.outputs.assigned_reviewers }}" | ||
echo "Additional info: ${{ steps.assign_reviewers.outputs.assigned_message }}" | ||
if (reviewers.size > 0) { | ||
await github.pulls.requestReviewers({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: context.payload.pull_request.number, | ||
reviewers: Array.from(reviewers) | ||
}); | ||
} | ||
echo "PR I unassigned reviewers to: ${{ steps.assign_reviewers.outputs.unassigned_url }}" | ||
echo "Commit SHA: ${{ github.sha }}" | ||
echo "I unassigned: ${{ steps.reviewer.outputs.unassigned_reviewers }}" | ||
echo "Additional info: ${{ steps.assign_reviewers.outputs.unassigned_message }}" | ||
await github.issues.addAssignees({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
assignees: [context.payload.pull_request.user.login] | ||
}); | ||
- 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" | ||
- name: Comment on PRs | ||
uses: dannyskoog/pull-request-comment@v1 | ||
with: | ||
message: I've labeled your PR, assigned you and requested reviews from the relevant people automatically. If you think I did it wrong, please comment below so one of our maintainers can double-check. Thanks! | ||
echo "PR I attempted to assign reviewers to: ${{ steps.assign_reviewers.outputs.assigned_url }}" | ||
echo "Commit SHA: ${{ github.sha }}" | ||
echo "Info: ${{ steps.assign_reviewers.outputs.assigned_message }}" | ||
echo "PR I unassigned reviewers to: ${{ steps.assign_reviewers.outputs.unassigned_url }}" | ||
echo "Commit SHA: ${{ github.sha }}" | ||
echo "Info: ${{ steps.assign_reviewers.outputs.unassigned_message }}" |