Skip to content

Commit f022678

Browse files
committed
Add a helpful PR comment if the docs have been updated but not the changelog
1 parent 78e059f commit f022678

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/add-comment.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Add helpful comment to PRs
2+
3+
env:
4+
changelog_path: "api-reference/v2/resources/changelog.mdx"
5+
6+
on:
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
branches:
12+
- main
13+
paths:
14+
- "openapi/*.json"
15+
- "api-reference/**.mdx"
16+
- "mint.json"
17+
18+
jobs:
19+
add-comment:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
pull-requests: read
23+
24+
steps:
25+
- id: changed-files
26+
uses: tj-actions/changed-files@v45
27+
with:
28+
files: |
29+
${{ env.changelog_path }}
30+
31+
- uses: mshick/add-pr-comment@v2
32+
if: steps.changed-files.outputs.any_changed != 'true'
33+
with:
34+
message: |
35+
It looks like you've made changes to the API docs! :raised_hands:
36+
:black_square_button: Update the changelog in `${{ env.changelog_path }}` - [:pencil2: Edit file](https://github.com/${{ github.repository }}/edit/${{ github.head_ref }}/${{ env.changelog_path }}) | [:bulb: Open Copilot workspace](https://copilot-workspace.githubnext.com/${{ github.repository }}/pull/${{ github.event.number }}?task=Update%20changelog)
37+
:point_right: You may want to [preview the changes in a Codespace](https://codespaces.new/${{ github.repository }}/pull/${{ github.event.number }}?quickstart=1)
38+
39+
- uses: mshick/add-pr-comment@v2
40+
if: steps.changed-files.outputs.any_changed == 'true'
41+
with:
42+
message: |
43+
It looks like you've made changes to the API docs! :raised_hands:
44+
:ballot_box_with_check: The changelog has been updated :tada:
45+
:point_right: You may want to [preview the changes in a Codespace](https://codespaces.new/${{ github.repository }}/pull/${{ github.event.number }}?quickstart=1)

.github/workflows/actions.yml renamed to .github/workflows/check-blocked.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Actions
1+
name: Check for blocking labels
22

33
on:
44
pull_request:

0 commit comments

Comments
 (0)