From 76210386a693dc0556a853c6322b95745564548c Mon Sep 17 00:00:00 2001 From: Jean-Hadrien Chabran Date: Wed, 31 Jul 2024 11:37:39 +0200 Subject: [PATCH] chore(ci): post instructions for PR sections in a comment (#64176) Follow-up to https://github.com/sourcegraph/devx-support/issues/1130 Moving the doc links to a comment is merely a few lines of GitHub Script, so it's worth doing it for better merge commit messages. ## Test plan This PR itself was the test, as you can see below the comments that resulted from this new GH workflow. Btw, the second one is the one you'll see in the code here. I went for a oneliner to avoid cluttering the UI. --- .github/PULL_REQUEST_TEMPLATE.md | 5 ----- .github/workflows/pr-guides.yml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pr-guides.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index cf56b2130e8..0ae1d5c2e9e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,9 +1,4 @@ - ## Test plan - - ## Changelog - - diff --git a/.github/workflows/pr-guides.yml b/.github/workflows/pr-guides.yml new file mode 100644 index 00000000000..10a7d566602 --- /dev/null +++ b/.github/workflows/pr-guides.yml @@ -0,0 +1,18 @@ +on: + pull_request_target: + types: [opened] + +jobs: + print-instructions: + name: "Comment with PR instructions" + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `:bulb: Learn more about each section: [PR description tips](https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e), [Test Plan](https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles) and [Changelog](https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c).`, + })