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.
This commit is contained in:
Jean-Hadrien Chabran 2024-07-31 11:37:39 +02:00 committed by GitHub
parent 8ef716d350
commit 76210386a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 5 deletions

View File

@ -1,9 +1,4 @@
<!-- PR description tips: https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e -->
## Test plan
<!-- REQUIRED; info at https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles -->
## Changelog
<!-- OPTIONAL; info at https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c -->

18
.github/workflows/pr-guides.yml vendored Normal file
View File

@ -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).`,
})