Skip to content

Instantly share code, notes, and snippets.

@jsumners
Created September 23, 2020 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsumners/cdf28e078cf5b6cebaa22c8e22d7b25b to your computer and use it in GitHub Desktop.
Save jsumners/cdf28e078cf5b6cebaa22c8e22d7b25b to your computer and use it in GitHub Desktop.
No WIP PR merges
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