Skip to content
4 changes: 2 additions & 2 deletions changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ submit workflow (write permissions, via workflow_run)
│ └── posts PR comment with view/edit links
├── if "no-label":
│ └── posts PR comment listing available labels
│ └── posts PR comment listing available type labels and skip labels
└── otherwise (skipped, manually-edited): no-op
```
Expand Down Expand Up @@ -169,7 +169,7 @@ rules:
exclude: "changelog:skip"
```

When all products are blocked by the create rules, the validate action passes with `skipped` status (so CI stays green) and the submit action exits without generating. If no matching type label is found (including when labels exist but none correspond to a configured type or skip rule), validate fails with `no-label` and submit posts a comment listing the available labels. You can also use `include` mode or per-product overrides. See [Rules for creation and publishing](https://elastic.github.io/docs-builder/contribute/changelog/#rules-for-creation-and-publishing) for the full reference.
When all products are blocked by the create rules, the validate action passes with `skipped` status (so CI stays green) and the submit action exits without generating. If no matching type label is found (including when labels exist but none correspond to a configured type or skip rule), validate fails with `no-label` and submit posts a comment listing the available type labels and skip labels (if configured), so contributors know how to opt out of changelog generation. You can also use `include` mode or per-product overrides. See [Rules for creation and publishing](https://elastic.github.io/docs-builder/contribute/changelog/#rules-for-creation-and-publishing) for the full reference.

## Manual edits

Expand Down
1 change: 1 addition & 0 deletions changelog/submit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ runs:
PR_NUMBER: ${{ steps.pr.outputs.number }}
LABEL_TABLE: ${{ steps.evaluate.outputs.label-table }}
PRODUCT_LABEL_TABLE: ${{ steps.evaluate.outputs.product-label-table }}
SKIP_LABELS: ${{ steps.evaluate.outputs.skip-labels }}
CONFIG_FILE: ${{ inputs.config }}
with:
github-token: ${{ inputs.github-token }}

This comment was marked as outdated.

Expand Down
12 changes: 11 additions & 1 deletion changelog/submit/scripts/post-failure-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = async ({ github, context, core }) => {
const configFile = process.env.CONFIG_FILE || 'docs/changelog.yml';
const labelRows = process.env.LABEL_TABLE || '';
const productLabelRows = process.env.PRODUCT_LABEL_TABLE || '';
const skipLabels = process.env.SKIP_LABELS || '';

let labelSection;
if (labelRows.trim()) {
Expand All @@ -28,14 +29,23 @@ module.exports = async ({ github, context, core }) => {
].join('\n');
}

let skipSection;
if (skipLabels.trim()) {
const formatted = skipLabels.split(',').map(l => `\`${l.trim()}\``).join(', ');
skipSection = `\n⏭️ To skip changelog generation, add one of these labels: ${formatted}`;
} else {
skipSection = `\n⏭️ No skip labels are configured. To allow skipping changelog generation, add a label to \`rules.create.exclude\` in \`${configFile}\`.`;
Comment on lines +32 to +37

This comment was marked as outdated.

}

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

await upsertComment({ github, context, prNumber, body });
Expand Down
Loading