Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIJN-9884-feature/Conditionally set release note headers #1684

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading