Skip to content

Commit 4618245

Browse files
Add GitHub Action to suggest maintenance branches for PRs targeting master (#2444)
1 parent bccfc2c commit 4618245

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: PR Branch Suggestion
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches:
7+
- master
8+
9+
jobs:
10+
suggest-branch:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- name: Suggest maintenance branch
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const comment = `### Branch Targeting Suggestion
20+
21+
You've targeted the \`master\` branch with this PR. Please consider if a version branch might be more appropriate:
22+
23+
- **\`maintenance-9.x\`** - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.
24+
25+
- **\`maintenance-10.x\`** - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x
26+
27+
If \`master\` is the correct target for this change, no action is needed.
28+
29+
---
30+
*This is an automated suggestion to help route contributions to the appropriate branch.*`;
31+
32+
github.rest.issues.createComment({
33+
issue_number: context.issue.number,
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
body: comment
37+
});

0 commit comments

Comments
 (0)