sourcegraph/.github/workflows/pr-guides.yml
Jean-Hadrien Chabran 76210386a6
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.
2024-07-31 09:37:39 +00:00

19 lines
822 B
YAML

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