Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b96d775537 |
No files matched your search
@@ -0,0 +1,13 @@
|
||||
## Summary
|
||||
<!-- What does this PR do? Keep it short (1-3 bullet points). -->
|
||||
|
||||
-
|
||||
|
||||
## Test plan
|
||||
<!-- How did you verify this works? -->
|
||||
|
||||
- [ ] `cargo fmt --all && cargo clippy --all-targets && cargo test`
|
||||
- [ ] Manual testing: `rtk <command>` output inspected
|
||||
|
||||
> **Important:** All PRs must target the `develop` branch (not `master`).
|
||||
> See [CONTRIBUTING.md](../blob/master/CONTRIBUTING.md) for details.
|
||||
@@ -0,0 +1,43 @@
|
||||
name: PR Target Branch Check
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, edited]
|
||||
|
||||
jobs:
|
||||
check-target:
|
||||
runs-on: ubuntu-latest
|
||||
# Skip develop→master PRs (maintainer releases)
|
||||
if: >-
|
||||
github.event.pull_request.base.ref == 'master' &&
|
||||
github.event.pull_request.head.ref != 'develop'
|
||||
steps:
|
||||
- name: Add wrong-base label
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const pr = context.payload.pull_request;
|
||||
|
||||
// Add label
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
labels: ['wrong-base']
|
||||
});
|
||||
|
||||
// Post comment
|
||||
const body = `👋 Thanks for the PR! It looks like this targets \`master\`, but all PRs should target the **\`develop\`** branch.
|
||||
|
||||
Please update the base branch:
|
||||
1. Click **Edit** at the top right of this PR
|
||||
2. Change the base branch from \`master\` to \`develop\`
|
||||
|
||||
See [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/master/CONTRIBUTING.md) for details.`;
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr.number,
|
||||
body: body
|
||||
});
|
||||
Reference in new issue
Block a user