From 6134026b720900ab5976fee0de3285ae5b98edfb Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Thu, 26 Nov 2026 16:04:30 +0000 Subject: [PATCH 1/3] chore/ci: Remind contributors where maintained docs live --- .github/workflows/docs-location-reminder.yml | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/docs-location-reminder.yml diff --git a/.github/workflows/docs-location-reminder.yml b/.github/workflows/docs-location-reminder.yml new file mode 100644 index 000000000..c4d829302 --- /dev/null +++ b/.github/workflows/docs-location-reminder.yml @@ -0,0 +1,36 @@ +name: Documentation location reminder + +on: + pull_request_target: + types: [opened, reopened] + +permissions: + pull-requests: write + +# Serialize runs for a PR so reopening it cannot create duplicate comments. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + +jobs: + comment: + runs-on: ubuntu-latest + steps: + # No checkout: fork PRs receive the reminder without running their code. + - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 + with: + script: | + const marker = '' + const issue = { ...context.repo, issue_number: context.issue.number } + const comments = await github.paginate(github.rest.issues.listComments, { + ...issue, + per_page: 100, + }) + if (comments.some(comment => comment.user.type === 'Bot' && comment.body?.includes(marker))) { + return + } + + await github.rest.issues.createComment({ + ...issue, + body: `${marker} + Updating product documentation? Please open your PR in [\`sourcegraph/sourcegraph/docs/\`](https://github.com/sourcegraph/sourcegraph/tree/main/docs). This repository only accepts urgent fixes for the legacy docs site.`, + }) From 07e2a215bffaa412c7167b7f0719c9ed34154d02 Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Thu, 26 Nov 2026 16:09:28 +0000 Subject: [PATCH 2/3] chore/ci: Align the docs reminder with existing comment workflows --- .github/workflows/docs-location-reminder.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs-location-reminder.yml b/.github/workflows/docs-location-reminder.yml index c4d829302..b79b9dd43 100644 --- a/.github/workflows/docs-location-reminder.yml +++ b/.github/workflows/docs-location-reminder.yml @@ -1,7 +1,7 @@ name: Documentation location reminder on: - pull_request_target: + pull_request: types: [opened, reopened] permissions: @@ -14,8 +14,10 @@ concurrency: jobs: comment: runs-on: ubuntu-latest + # Fork PRs get a read-only token, as in the other docs commenting workflows. + if: github.event.pull_request.head.repo.full_name == github.repository steps: - # No checkout: fork PRs receive the reminder without running their code. + # No checkout: this workflow only posts a fixed comment. - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 with: script: | @@ -25,7 +27,7 @@ jobs: ...issue, per_page: 100, }) - if (comments.some(comment => comment.user.type === 'Bot' && comment.body?.includes(marker))) { + if (comments.some(comment => comment.body?.includes(marker))) { return } From 52e3d0175f8e22d34e9a52f0050e7b0e633c467b Mon Sep 17 00:00:00 2001 From: Taras Yemets Date: Thu, 26 Nov 2026 16:17:08 +0000 Subject: [PATCH 3/3] chore/ci: Show the docs location reminder as an Important callout --- .github/workflows/docs-location-reminder.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs-location-reminder.yml b/.github/workflows/docs-location-reminder.yml index b79b9dd43..117308fa0 100644 --- a/.github/workflows/docs-location-reminder.yml +++ b/.github/workflows/docs-location-reminder.yml @@ -34,5 +34,6 @@ jobs: await github.rest.issues.createComment({ ...issue, body: `${marker} - Updating product documentation? Please open your PR in [\`sourcegraph/sourcegraph/docs/\`](https://github.com/sourcegraph/sourcegraph/tree/main/docs). This repository only accepts urgent fixes for the legacy docs site.`, + > [!IMPORTANT] + > Updating product documentation? Please open your PR in [\`sourcegraph/sourcegraph/docs/\`](https://github.com/sourcegraph/sourcegraph/tree/main/docs). This repository only accepts urgent fixes for the legacy docs site.`, })