-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Maintenance run 2024-05-06 * pr-title-check toegevoegd en dependabot dependency update --------- Co-authored-by: timvanoostrom <[email protected]> Co-authored-by: Roan Paulus <[email protected]>
- Loading branch information
1 parent
762f6d3
commit 2a2dc35
Showing
2 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Taken from: https://levelup.gitconnected.com/enforcing-jira-ticket-formatting-in-github-pr-titles-and-commit-messages-78d9755568df | ||
name: 'PR Title Check' | ||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
jobs: | ||
check-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR title | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const payload = context.payload | ||
const prTitle = payload.pull_request.title | ||
// Titel moet beginnen met mijn-xxxx of Bump! | ||
const jiraPattern = /(mijn-\d+|bump!)/gi | ||
if (!jiraPattern.test(prTitle)) { | ||
console.log('The PR title does not match JIRA ticket format!') | ||
// Fails the workflow | ||
core.setFailed('PR title does not match JIRA ticket format!') | ||
} else { | ||
console.log('PR title format is correct.') | ||
} |
This file contains 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