Created
September 23, 2020 13:28
-
-
Save jsumners/cdf28e078cf5b6cebaa22c8e22d7b25b to your computer and use it in GitHub Desktop.
No WIP PR merges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "No WIP PR Title" | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- edited | |
- synchronize | |
jobs: | |
check-title: | |
name: "Check Title" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Verify PR Title Clean" | |
uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const title = context.payload.pull_request.title | |
const regex = /^.?(WIP|wip)([\]\):]{1,2})?\s/ | |
if (regex.test(title) === true) { | |
core.setFailed('Title starts with WIP token.') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment