-
Notifications
You must be signed in to change notification settings - Fork 2
Describe skip label availability and add skip-specific comment #53
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,9 +251,22 @@ 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 }} | ||
| script: | | ||
| const script = require('${{ github.action_path }}/scripts/post-failure-comment.js'); | ||
| await script({ github, context, core }); | ||
|
|
||
| - name: Post skipped comment | ||
| if: steps.evaluate.outputs.status == 'skipped' | ||
| uses: actions/github-script@v8 | ||
| env: | ||
| PR_NUMBER: ${{ steps.pr.outputs.number }} | ||
| SKIP_LABELS: ${{ steps.evaluate.outputs.skip-labels }} | ||
| with: | ||
| github-token: ${{ inputs.github-token }} | ||
| script: | | ||
| const script = require('${{ github.action_path }}/scripts/post-skipped-comment.js'); | ||
| await script({ github, context, core }); | ||
|
Comment on lines
+262
to
+272
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop this step.
Only condition 3 involves labels. For conditions 1 and 2, this would post a confusing "changelog was skipped" comment with no matched skip labels — noise on PRs that were never trying to generate a changelog in the first place. Contributors who added a skip label already know it worked (their PR stays green). They don't need a bot comment confirming it. The skip-label info in the failure comment ( |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| const { TITLE, upsertComment } = require('./comment-helper'); | ||
|
|
||
| module.exports = async ({ github, context, core }) => { | ||
| const prNumber = parseInt(process.env.PR_NUMBER, 10); | ||
| const skipLabels = process.env.SKIP_LABELS || ''; | ||
|
|
||
| const bodyParts = [ | ||
| TITLE, | ||
| '', | ||
| '⏭️ Changelog generation was skipped for this pull request.', | ||
| ]; | ||
|
|
||
| if (skipLabels.trim()) { | ||
| const formatted = skipLabels.split(',').map(l => `\`${l.trim()}\``).join(', '); | ||
| bodyParts.push('', `Matched skip label(s): ${formatted}`); | ||
| } | ||
|
|
||
| await upsertComment({ github, context, prNumber, body: bodyParts.join('\n') }); | ||
| }; | ||
|
Comment on lines
+1
to
+19
This comment was marked as outdated.
Sorry, something went wrong. |
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.