Skip to content

Commit b4c5188

Browse files
feat: add PR Review request workflow (#632)
## PR Checklist - [x] Addresses an existing open issue: fixes #312 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/template-typescript-node-package/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/template-typescript-node-package/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Adds two actions: * `pr-review-requested.yml`: removes `status: waiting for author` when a PR review is requested * `pr-review-submitted.yml`: adds `status: waiting for author` when a PR review is submitted
1 parent e8c3d7d commit b4c5188

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
jobs:
2+
pr_review_requested:
3+
runs-on: ubuntu-latest
4+
steps:
5+
- uses: actions-ecosystem/action-remove-labels@v1
6+
with:
7+
labels: "status: waiting for author"
8+
- if: failure()
9+
run: |
10+
echo "Don't worry about if the previous step failed."
11+
echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
12+
13+
name: PR Review Requested
14+
15+
on:
16+
pull_request_target:
17+
types:
18+
- review_requested
19+
20+
permissions:
21+
pull-requests: write

src/hydrate/steps/writing/creation/dotGitHub/createWorkflowFile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ interface WorkflowFileOn {
1313
}
1414
| null
1515
| string;
16+
pull_request_target?: {
17+
types: string[];
18+
};
1619
push?: {
1720
branches: string[];
1821
};

src/hydrate/steps/writing/creation/dotGitHub/workflows.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,29 @@ export function createWorkflows({
104104
},
105105
],
106106
}),
107+
"pr-review-requested.yml": createWorkflowFile({
108+
name: "PR Review Requested",
109+
on: {
110+
pull_request_target: {
111+
types: ["review_requested"],
112+
},
113+
},
114+
permissions: {
115+
"pull-requests": "write",
116+
},
117+
steps: [
118+
{
119+
uses: "actions-ecosystem/action-remove-labels@v1",
120+
with: {
121+
labels: "status: waiting for author",
122+
},
123+
},
124+
{
125+
if: "failure()",
126+
run: 'echo "Don\'t worry about if the previous step failed."\necho "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."\n',
127+
},
128+
],
129+
}),
107130
"prettier.yml": createWorkflowFile({
108131
name: "Prettier",
109132
runs: ["pnpm format --list-different"],

0 commit comments

Comments
 (0)