Skip to content

Commit

Permalink
Add action to check PR target (#1337)
Browse files Browse the repository at this point in the history
* Add action to check PR target

* Update .github/workflows/target-main.yml

Co-authored-by: Matteo Collina <hello@matteocollina.com>

Co-authored-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
jsumners and mcollina authored Feb 15, 2022
1 parent 3053a99 commit 33542d1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/target-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
pull_request_target:
types: [opened]

jobs:
comment:
if: ${{ github.base_ref }} != "master"
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '⚠️ This pull request does not target the master branch.'
})

0 comments on commit 33542d1

Please sign in to comment.