forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.26 KB
/
add-review-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Add review template
# **What it does**: When a specific label is added to a PR, adds the contents of .github/review-template.md as a comment in the PR
# **Why we have it**: To help Docs Content team members ensure that their PR is ready for review
# **Who does it impact**: docs-internal maintainers and contributors
on:
pull_request:
types:
- labeled
permissions:
contents: read
jobs:
comment-that-approved:
name: Add review template
runs-on: ubuntu-latest
if: github.event.label.name == 'add-review-template' && github.repository == 'github/docs-internal'
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
# Jump through some hoops to work with a multi-line file
- name: Store review template in variable
run: |
TEMPLATE=$(cat .github/review-template.md)
echo "TEMPLATE<<EOF" >> $GITHUB_ENV
echo "$TEMPLATE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment on the PR
run: |
gh pr comment $PR --body "$TEMPLATE"
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW_READORG }}
PR: ${{ github.event.pull_request.html_url }}
TEMPLATE: ${{ env.TEMPLATE }}