From d0f47e7d532bfc7ba3fb71e212584a0f9854c2e6 Mon Sep 17 00:00:00 2001 From: Jean-Hadrien Chabran Date: Tue, 14 May 2024 14:25:42 +0200 Subject: [PATCH] chore(gha): comment on PR about reviews (#8942) Implements https://www.notion.so/sourcegraph/Set-up-a-restriction-on-PRs-to-require-approval-for-merging-89710798660744e8a84dab75a17deb85?pvs=4 --- .github/workflows/notion-migration.yaml | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/notion-migration.yaml diff --git a/.github/workflows/notion-migration.yaml b/.github/workflows/notion-migration.yaml new file mode 100644 index 000000000000..5f4b4c70055e --- /dev/null +++ b/.github/workflows/notion-migration.yaml @@ -0,0 +1,26 @@ +name: Notion Migration + +on: + pull_request: + types: [opened, reopened] + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "> [!WARNING] \n> As we're migrating to Notion, we want to make sure that changes to the handbook are absolutely necessary. To ensure it is the case, it's now mandatory to get an approving review to merge a pull request.\n\nExamples\n\n- Setting up a redirection to a Notion page: PR will be approved.\n- Correcting an important mistake on a page that doesn't have an equivalent yet: PR will be approved.\n- Updating content that isn't mission critical: PR will be rejected.\n\nSourcegraphers: Reach out to [#wg-notion](https://sourcegraph.slack.com/archives/C06T68DBMSA) if you have any question." + }) + + github.rest.pulls.requestReviewers({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + reviewers: ["madisongclark"] + });