mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2026-01-27 17:37:20 +01:00
Add PR branch check action (#2536)
This commit is contained in:
parent
4ee09729cf
commit
69e018504d
1 changed files with 28 additions and 0 deletions
28
.github/workflows/pr-check.yml
vendored
Normal file
28
.github/workflows/pr-check.yml
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
name: Make sure PRs target the develop branch
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
|
||||||
|
# By default, pull_request_target gets write permissions to the repo - this prevents that
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-branch:
|
||||||
|
if: github.event.pull_request.base.ref == 'master'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Add comment
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: 'Please do not submit against `master`, use `develop` instead'
|
||||||
|
})
|
||||||
|
- name: Throw error
|
||||||
|
run: |
|
||||||
|
echo "::error title=wrong-branch::Please do not submit against 'master', use 'develop' instead"
|
||||||
|
exit 1
|
||||||
Loading…
Add table
Reference in a new issue