diff --git a/.github/workflows/pr-review-requested.yml b/.github/workflows/pr-review-requested.yml new file mode 100644 index 000000000..3676b2610 --- /dev/null +++ b/.github/workflows/pr-review-requested.yml @@ -0,0 +1,21 @@ +jobs: + pr_review_requested: + runs-on: ubuntu-latest + steps: + - uses: actions-ecosystem/action-remove-labels@v1 + with: + labels: "status: waiting for author" + - if: failure() + run: | + echo "Don't worry about if the previous step failed." + echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221." + +name: PR Review Requested + +on: + pull_request_target: + types: + - review_requested + +permissions: + pull-requests: write diff --git a/src/hydrate/steps/writing/creation/dotGitHub/createWorkflowFile.ts b/src/hydrate/steps/writing/creation/dotGitHub/createWorkflowFile.ts index 0aed6905b..a38aa10f2 100644 --- a/src/hydrate/steps/writing/creation/dotGitHub/createWorkflowFile.ts +++ b/src/hydrate/steps/writing/creation/dotGitHub/createWorkflowFile.ts @@ -13,6 +13,9 @@ interface WorkflowFileOn { } | null | string; + pull_request_target?: { + types: string[]; + }; push?: { branches: string[]; }; diff --git a/src/hydrate/steps/writing/creation/dotGitHub/workflows.ts b/src/hydrate/steps/writing/creation/dotGitHub/workflows.ts index 57503c2df..a9c440b76 100644 --- a/src/hydrate/steps/writing/creation/dotGitHub/workflows.ts +++ b/src/hydrate/steps/writing/creation/dotGitHub/workflows.ts @@ -104,6 +104,29 @@ export function createWorkflows({ }, ], }), + "pr-review-requested.yml": createWorkflowFile({ + name: "PR Review Requested", + on: { + pull_request_target: { + types: ["review_requested"], + }, + }, + permissions: { + "pull-requests": "write", + }, + steps: [ + { + uses: "actions-ecosystem/action-remove-labels@v1", + with: { + labels: "status: waiting for author", + }, + }, + { + if: "failure()", + run: 'echo "Don\'t worry about if the previous step failed."\necho "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."\n', + }, + ], + }), "prettier.yml": createWorkflowFile({ name: "Prettier", runs: ["pnpm format --list-different"],