Skip to content

Commit 386763e

Browse files
committed
add an action to ask for a migration guide when one is missing (#7507)
# Objective - Help ensure migration guide are present for breaking changes ## Solution - Add an action that adds a comment when it's missing <img width="918" alt="Screenshot 2023-02-05 at 03 06 13" src="https://user-images.githubusercontent.com/8672791/216797861-3cbde59a-6e21-464a-9b83-a28a2474d111.png">
1 parent 52f0617 commit 386763e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Action on PR labeled
2+
3+
# This workflow has write permissions on the repo
4+
# It must not checkout a PR and run untrusted code
5+
6+
on:
7+
pull_request_target:
8+
types:
9+
- labeled
10+
11+
permissions:
12+
pull-requests: 'write'
13+
14+
jobs:
15+
comment-on-breaking-change-label:
16+
runs-on: ubuntu-latest
17+
if: github.event.label.name == 'C-Breaking-Change' && !contains(github.event.pull_request.body, '## Migration Guide')
18+
steps:
19+
- uses: actions/github-script@v6
20+
with:
21+
script: |
22+
await github.rest.issues.createComment({
23+
issue_number: context.issue.number,
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
body: `It looks like your PR is a breaking change, but you didn't provide a migration guide.
27+
28+
Could you add some context on what users should update when this change get released in a new version of Bevy?
29+
It will be used to help writing the migration guide for the version. Putting it after a \`## Migration Guide\` will help it get automatically picked up by our tooling.`
30+
})

0 commit comments

Comments
 (0)