Skip to content
Merged
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
2 changes: 2 additions & 0 deletions changelog/submit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ runs:
CHANGELOG_TYPE: ${{ steps.evaluate.outputs.type }}
CHANGELOG_OWNER: ${{ github.repository_owner }}
CHANGELOG_REPO: ${{ github.event.repository.name }}
CHANGELOG_PRODUCTS: ${{ steps.evaluate.outputs.products }}
run: |
mkdir -p /tmp/changelog-staging
docs-builder changelog add \
Expand Down Expand Up @@ -247,6 +248,7 @@ runs:
env:
PR_NUMBER: ${{ steps.pr.outputs.number }}
LABEL_TABLE: ${{ steps.evaluate.outputs.label-table }}
PRODUCT_LABEL_TABLE: ${{ steps.evaluate.outputs.product-label-table }}
CONFIG_FILE: ${{ inputs.config }}
with:
github-token: ${{ inputs.github-token }}
Expand Down
14 changes: 13 additions & 1 deletion changelog/submit/scripts/post-failure-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,36 @@ module.exports = async ({ github, context, core }) => {
const prNumber = parseInt(process.env.PR_NUMBER, 10);
const configFile = process.env.CONFIG_FILE || 'docs/changelog.yml';
const labelRows = process.env.LABEL_TABLE || '';
const productLabelRows = process.env.PRODUCT_LABEL_TABLE || '';

let labelSection;
if (labelRows.trim()) {
labelSection = [
'',
'🔖 Add one of these labels to your PR:',
'🔖 Add one of these **type** labels to your PR:',
'',
labelRows,
].join('\n');
} else {
labelSection = `\nAdd a type label that matches your \`pivot.types\` configuration in \`${configFile}\`.`;
}

let productSection = '';
if (productLabelRows.trim()) {
productSection = [
'',
'📦 Add one or more **product** labels:',
'',
productLabelRows,
].join('\n');
}

const body = [
TITLE,
'',
'⚠️ **Cannot generate changelog:** no matching type label found on this PR.',
labelSection,
productSection,
'',
`🔖 To skip changelog generation or configure label rules, see \`${configFile}\`.`,
].join('\n');
Expand Down
Loading