Skip to content

Commit

Permalink
Conditionally set note headers
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarBakker committed Dec 19, 2024
1 parent e3ab7b2 commit 592888b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ jobs:
// Titel moet beginnen met mijn-xxxx-chore/feature/bug! todo mijn- patroon moet weggehaald worden wanneer de workflows van mijn-7620 gemerged zijn
const jiraPattern = /^MIJN-\d+-(CHORE|FEATURE|BUG)/i
const dependabotPattern = /^Build\(deps(-dev)?\): bump/
const disallowedQuotesPattern = /"/
if (!(jiraPattern.test(prTitle) || dependabotPattern.test(prTitle))) {
if (disallowedQuotesPattern.test(prTitle)) {
console.log('The PR title contains double quotes, which are not allowed!')
core.setFailed('PR title not valid. Please remove double quotes from the title.')
} else if (!(jiraPattern.test(prTitle) || dependabotPattern.test(prTitle))) {
console.log('The PR title does not match JIRA ticket format!')
// Fails the workflow
core.setFailed('PR title not valid. Please make sure this PR uses the JIRA ticket or dependabot format.')
} else {
console.log('PR title format is correct.')
Expand Down
35 changes: 22 additions & 13 deletions .github/workflows/release-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,31 @@ jobs:
grep -iE 'BUG:|MIJN-[0-9]+-BUG' release_notes.txt > bugs.txt || true
grep -iE 'MIJN-[0-9]+($|[^-])' release_notes.txt > mijn.txt || true
echo "chores<<EOF" >> $GITHUB_OUTPUT
cat chores.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Output Categorized Notes
run: |
if [ -s chores.txt ]; then
echo "chores<<EOF" >> $GITHUB_OUTPUT
cat chores.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
echo "features<<EOF" >> $GITHUB_OUTPUT
cat features.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
if [ -s features.txt ]; then
echo "features<<EOF" >> $GITHUB_OUTPUT
cat features.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
echo "bugs<<EOF" >> $GITHUB_OUTPUT
cat bugs.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
if [ -s bugs.txt ]; then
echo "bugs<<EOF" >> $GITHUB_OUTPUT
cat bugs.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
echo "mijn<<EOF" >> $GITHUB_OUTPUT
cat mijn.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
shell: bash
if [ -s mijn.txt ]; then
echo "mijn<<EOF" >> $GITHUB_OUTPUT
cat mijn.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Create Customized Release Notes
id: custom_release_notes
Expand Down

0 comments on commit 592888b

Please sign in to comment.