Skip to content

Instantly share code, notes, and snippets.

@jbcpollak
Created March 3, 2023 19:02
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 jbcpollak/b86d32f092a7ad3f413df348803326e2 to your computer and use it in GitHub Desktop.
Save jbcpollak/b86d32f092a7ad3f413df348803326e2 to your computer and use it in GitHub Desktop.
Validating / Linting your PR summary with a JIRA ticket
name: "[Validation] Pull Request"
on:
pull_request:
# By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. We
# explicity override here so that PR titles are re-linted when the PR text content is edited.
#
# Possible values: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
types: ["opened", "edited", "reopened", "synchronize"]
branches:
- 'main**'
jobs:
validation_pull_request:
name: "[Validation] Pull Request"
runs-on: ubuntu-latest
# Make sure this is actually a PR before running, otherwise silently succeed
if: github.event_name == 'pull_request'
steps:
- name: Lint PR title
uses: amannn/action-semantic-pull-request@v4.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
subjectPattern: '.*\[PROJ-\d*\]\s*'
subjectPatternError: No JIRA ticket found at the end of the PR title.
types: fix, feat
@jbcpollak
Copy link
Author

jira

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment