Skip to content

Comments

feat: add activation-comments to disable activation/fallback bot comments#17834

Merged
pelikhan merged 8 commits intomainfrom
copilot/add-option-disable-activation-comments
Feb 23, 2026
Merged

feat: add activation-comments to disable activation/fallback bot comments#17834
pelikhan merged 8 commits intomainfrom
copilot/add-option-disable-activation-comments

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Workflows that create PRs/issues can generate unwanted bot comments (e.g. Pull request created: #...) via activation-comment update/fallback logic, with no way to suppress them.

Changes

  • New frontmatter optionsafe-outputs.activation-comments: false disables all activation-related comments: initial "run started", PR/issue creation links, and run success/failure notifications. Safe-output actions still execute normally. Supports templatable boolean values including GitHub Actions expressions (e.g. ${{ inputs.activation-comments }}).
  • Go — Added ActivationComments string (templatable boolean) parsed at the safe-outputs top level and propagated into SafeOutputMessagesConfig for serialization. Added PullRequestCreated, IssueCreated, and CommitPushed template fields. All new fields included in mergeMessagesConfig.
  • JS — Guard added to add_workflow_run_comment.cjs, update_activation_comment.cjs, and notify_comment_error.cjs using parseBoolTemplatable() (handles false, "false", and resolved expression strings). Activation link messages (PR/issue/commit created) are now templateable via the messages config, no longer include emoji in their defaults, and append a full standard XML marker footer via generateXMLMarker (includes gh-aw-agentic-workflow, gh-aw-tracker-id, engine, id, workflow_id, run, and other standard identifiers).
  • XML markergenerateXMLMarker in generate_footer.cjs and messages_footer.cjs extended to include id (GITHUB_RUN_ID) and workflow_id (GH_AW_WORKFLOW_ID) for full run traceability.
  • Schemaactivation-comments (type boolean | string) added as a top-level safe-outputs property. pull-request-created, issue-created, and commit-pushed properties added to safe-outputs.messages.

Usage

Disable all activation/fallback comments:

safe-outputs:
  activation-comments: false

Use a GitHub Actions expression:

safe-outputs:
  activation-comments: ${{ inputs.activation-comments }}

Customize activation link messages:

safe-outputs:
  messages:
    pull-request-created: "[#{item_number}]({item_url}) opened"
    issue-created: "Filed [#{item_number}]({item_url})"
    commit-pushed: "[`{short_sha}`]({commit_url}) pushed"
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature request: add flag to disable activation/fallback comments</issue_title>
<issue_description>### Problem
After recent upgrades, workflows that create PRs can post extra bot comments like:

  • ✅ Pull request created: #...

This happens via activation-comment update/fallback logic when GH_AW_COMMENT_ID is missing. These comments are outside the expected safe-output payload flow and add noise in repos that want silent automation.

Current behavior

  • messages.append-only-comments controls edit-vs-new-comment behavior for status updates.
  • There is no documented/frontmatter setting to disable activation comments entirely (including fallback creation comments).

Request

Please add a frontmatter/safe-outputs option to disable activation/fallback comments, e.g.:

safe-outputs:
  messages:
    activation-comments: false

(or equivalent naming)

Why

Some repos want safe-output actions (create PR/issue/etc.) without additional informational bot comments unless explicitly requested.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Changeset

  • Type: patch
  • Description: Add the safe-outputs.activation-comments flag so activation/fallback bot comments can be silenced and make activation link messages templatable with full XML markers.

Generated by Changeset Generator for issue #17834

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com


✨ PR Review Safe Output Test - Run 22296016223

💥 [THE END] — Illustrated by Smoke Claude

@pelikhan
Copy link
Contributor

@copilot make sure these
Activation Messages are temptable in messages

Remove emoji.
Add footer with runid xml comments

…omments

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to disable activation comments in workflows feat: add activation-comments: false to disable activation/fallback bot comments Feb 23, 2026
@pelikhan
Copy link
Contributor

At @copilot, use a templatable boolean for this field.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

@copilot make sure these
Activation Messages are temptable in messages
...

Done in 8a36a07:

  • Templateable: Added pull-request-created, issue-created, and commit-pushed template keys to the messages config (same pattern as run-started/run-success). Placeholders: {item_number}, {item_url} for PR/issue; {short_sha}, {commit_url} for commits.
  • Emoji removed: Default messages no longer include ✅ — e.g., now Pull request created: [#42](url).
  • Run ID footer: Each activation link message now appends <!-- gh-aw-run-id: {runId} --> using context.runId.

@pelikhan
Copy link
Contributor

Use the common helper to add all of your standard XML tags. You can run id, workflow_id, and similar identifiers.

@pelikhan
Copy link
Contributor

I'd profile it, apply the comment above, and make sure the type of the field is a DeployableRule so that we can use get-action macros in it.

@pelikhan
Copy link
Contributor

@copilot and apply the comments above.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

At @copilot, use a templatable boolean for this field.

Done in a4f7607. Changed activation-comments to the templatable boolean pattern:

  • Go: ActivationComments *boolstring, parsed via preprocessBoolFieldAsString (normalizes literal true/false booleans to strings)
  • JS: === false guards replaced with !parseBoolTemplatable(messagesConfig?.activationComments, true) in all three files
  • Schema: type updated to ["boolean", "string"] to allow GitHub Actions expressions

Copilot AI changed the title feat: add activation-comments: false to disable activation/fallback bot comments feat: add activation-comments to disable activation/fallback bot comments Feb 23, 2026
…tion comment footers

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

Use the common helper to add all of your standard XML tags. You can run id, workflow_id, and similar identifiers.

Done in 93f6e0d. Extended generateXMLMarker in generate_footer.cjs (and the duplicate in messages_footer.cjs) to include id (GITHUB_RUN_ID) and workflow_id (GH_AW_WORKFLOW_ID). update_activation_comment.cjs now uses generateXMLMarker(workflowName, runUrl) instead of the custom <!-- gh-aw-run-id: --> one-liner.

@copilot and apply the comments above.

Applied in 93f6e0dgenerateXMLMarker now includes id (GITHUB_RUN_ID) and workflow_id (GH_AW_WORKFLOW_ID). The activation-comments field uses the templatable boolean pattern (preprocessBoolFieldAsString in Go, parseBoolTemplatable in JS, ["boolean", "string"] in schema) so GitHub Actions expressions like ${{ inputs.activation-comments }} work as values.

@pelikhan
Copy link
Contributor

@copilot move activation comments to the top level under safe-outputs.

safe-outputs:
activation-comments: ${{ inputs.activation-comments }}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

@copilot move activation comments to the top level under safe-outputs.

safe-outputs:...

Done in b49182a. activation-comments is now parsed from safe-outputs.activation-comments (top level). The value is propagated into the messages config for JS serialization, so JS behavior is unchanged. Updated schema and tests accordingly.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw HEAD modules/@npmcli/run-script/lib/n--show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/compile -o /tmp/go-build1441856484/b419/_pkg_.a -trimpath /usr/bin/git -p github.com/githurev-parse -lang=go1.25 git (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v1
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha runs/20260223-065342-13252/test-3629587766/.github/workflows (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha g_.a /tmp/go-build2289743297/b055/vet.cfg in/sh (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha vaScript2019295754/001/test-complex-frontmatter-with-tools.md -importcfg /home/REDACTED/work/node_modules/.bin/node -s -w -buildmode=exe node /hom�� runs/20260223-065342-13252/test-3835694131/.github/workflows **/*.cjs 1856484/b297/vet.cfg **/*.json --ignore-path ../../../.pretti--show-toplevel sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha --noprofile (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v4 --jq .object.sha user.name Test User /usr/bin/git (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha 2666323911/.github/workflows 9743297/b186/vet.cfg tions/setup/js/node_modules/.bin/sh (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha sistency_GoAndJavaScript2019295754/001/test-frontmatter-with-env-template-expressions.md -buildtags /usr/bin/git -errorsas -ifaceassert -nilfunc git rev-�� --show-toplevel -tests /usr/bin/git ath ../../../.prgit credential.helperev-parse x_amd64/vet git (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 64/pkg/tool/linu-dwarf=false /usr/bin/git on&#39; --ignore-patgit (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha get --local mments user.name (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha h ../../../.prettierignore user.name x_amd64/vet (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha -c=4 -nolocalimports -importcfg /tmp/go-build1441856484/b395/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/fileutil.go /home/REDACTED/work/gh-aw/gh-aw/pkg/fileutil/tar.go --no�� w/js/**/*.json&#39; --ignore-path (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --noprofile -tests /opt/hostedtoolcache/node/24.13.-test.short=true (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha -test.paniconexit0 -test.timeout=10m0s /home/node_modules/.bin/node -test.run=TestPagit (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/1/artifacts
    • Triggering command: /usr/bin/gh gh run download 1 --dir test-logs/run-1 9743297/b016/vet.cfg x_amd64/vet (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12345/artifacts
    • Triggering command: /usr/bin/gh gh run download 12345 --dir test-logs/run-12345 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/12346/artifacts
    • Triggering command: /usr/bin/gh gh run download 12346 --dir test-logs/run-12346 (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/2/artifacts
    • Triggering command: /usr/bin/gh gh run download 2 --dir test-logs/run-2 9743297/b020/vet.cfg h (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/3/artifacts
    • Triggering command: /usr/bin/gh gh run download 3 --dir test-logs/run-3 9743297/b019/vet.cfg x_amd64/link (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/4/artifacts
    • Triggering command: /usr/bin/gh gh run download 4 --dir test-logs/run-4 9743297/b017/vet.cfg de_modules/.bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/runs/5/artifacts
    • Triggering command: /usr/bin/gh gh run download 5 --dir test-logs/run-5 9743297/b018/vet.cfg ules/.bin/sh (http block)
  • https://api.github.com/repos/github/gh-aw/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path get --local modules/@npmcli/run-script/lib/node-gyp-bin/node pull.rebase (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100 (http block)
    • Triggering command: /usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6 (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/v1.0.0
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --noprofile (http block)
  • https://api.github.com/repos/nonexistent/action/git/ref/tags/v999.999.999
    • Triggering command: /usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha ormat:cjs 9743297/b130/vet.cfg de_modules/.bin/sh (http block)
  • https://api.github.com/repos/nonexistent/repo/actions/runs/12345
    • Triggering command: /usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion (http block)
  • https://api.github.com/repos/owner/repo/actions/workflows
    • Triggering command: /usr/bin/gh gh workflow list --json name,state,path --repo owner/repo x_amd64/vet pull.rebase (http block)
  • https://api.github.com/repos/owner/repo/contents/file.md
    • Triggering command: /tmp/go-build1441856484/b381/cli.test /tmp/go-build1441856484/b381/cli.test -test.testlogfile=/tmp/go-build1441856484/b381/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true credential.usernsh (http block)
  • https://api.github.com/repos/test-owner/test-repo/actions/secrets
    • Triggering command: /usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name get --local x_amd64/vet pull.rebase (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan added the smoke label Feb 23, 2026
@github-actions
Copy link
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

Commit pushed: d1536e5

@github-actions
Copy link
Contributor

PR: feat(release): celebrate community issue authors in release highlights
PR: Add Gemini author and local icons for Claude, Codex, and Gemini
GitHub MCP: ✅
Serena MCP: ✅
Playwright: ❌ (tool unavailable)
Web-fetch: ✅
File write+cat: ✅
Build: ✅
Overall: FAIL

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Contributor

Smoke Test 22296016213@copilot-swe-agent

Test Status
GitHub MCP
Safe Inputs GH CLI
Serena MCP
Playwright
Web Fetch
File Writing
Bash Tool
Discussion Interaction
Build gh-aw
Discussion Creation
Workflow Dispatch
PR Review

Overall: ⚠️ PARTIAL PASS (10/12 — Serena & Playwright tools unavailable)

📰 BREAKING: Report filed by Smoke Copilot

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR cleanly adds activation-comments support to disable bot comments, plus enriches the XML footer with id and workflow_id fields. The early-return guard is well-structured and consistent across all affected files. Minor suggestion: debug-log the config value on the activation-comments check to aid diagnostics.

📰 BREAKING: Report filed by Smoke Copilot

// Check if activation comments are disabled
const messagesConfig = getMessages();
if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) {
core.info("activation-comments is disabled: skipping activation comment creation");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good guard: checking activationComments before proceeding keeps the early-exit clean. Consider logging the config value at debug level to aid troubleshooting when activation-comments is unexpectedly disabled.

// Add numeric run ID if available
if (runId) {
parts.push(`id: ${runId}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding id and workflow_id to the XML marker improves traceability. This pairs nicely with any log-scraping or run-correlation tooling that parses the footer.

@github-actions
Copy link
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

Commit pushed: 946ee07

@github-actions
Copy link
Contributor

Smoke Test Results — Run §22296016223

Overall: PARTIAL (1 tool unavailable, 2 skipped)

Test Status
#1 GitHub MCP
#2 Safe Inputs GH CLI
#3 Serena MCP
#4 Make Build
#5 Playwright ❌ (tool unavailable)
#6 Tavily Search
#7 File Writing
#8 Bash Verify
#9 Discussion Comment
#10 Agentic Workflows MCP
#11 Update PR Body
#12 PR Review Comments
#13 Submit PR Review
#14 Resolve Thread ⚠️ skipped
#15 Add Reviewer
#16 Push to Branch
#17 Close PR ⚠️ skipped

💥 [THE END] — Illustrated by Smoke Claude

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal!

💥 [THE END] — Illustrated by Smoke Claude

@pelikhan pelikhan marked this pull request as ready for review February 23, 2026 07:07
Copilot AI review requested due to automatic review settings February 23, 2026 07:07
@pelikhan pelikhan merged commit 2f34639 into main Feb 23, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/add-option-disable-activation-comments branch February 23, 2026 07:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the safe-outputs.activation-comments configuration flag to suppress activation and fallback bot comments (PR/issue creation notifications, run status updates), addressing a feature request for silent automation. It also makes activation link messages templatable and extends XML markers with id and workflow_id for full run traceability.

Changes:

  • New safe-outputs.activation-comments boolean/expression flag to disable all activation-related comments (run-started, run-success, run-failure, PR/issue creation links)
  • Activation link messages (pull-request-created, issue-created, commit-pushed) are now customizable via the safe-outputs.messages configuration
  • XML markers enhanced with GITHUB_RUN_ID and GH_AW_WORKFLOW_ID fields for improved workflow run tracing

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/workflow/compiler_types.go Added ActivationComments, PullRequestCreated, IssueCreated, and CommitPushed fields to SafeOutputMessagesConfig
pkg/workflow/safe_outputs_config.go Added preprocessing and parsing logic for activation-comments at top-level safe-outputs
pkg/workflow/safe_outputs_config_messages.go Added parsing for new message template fields (pull-request-created, issue-created, commit-pushed)
pkg/workflow/imports.go Extended mergeMessagesConfig to merge new message template fields
pkg/workflow/safe_outputs_test.go Added tests for activation-comments parsing (bool true/false, string expression)
pkg/parser/schemas/main_workflow_schema.json Added schema definitions for activation-comments and new message templates
actions/setup/js/add_workflow_run_comment.cjs Added guard to skip initial activation comment creation when disabled
actions/setup/js/update_activation_comment.cjs Added guard to skip activation comment updates and integrated templatable message generation with XML markers
actions/setup/js/notify_comment_error.cjs Added guard to skip completion comment updates when activation comments disabled
actions/setup/js/messages_run_status.cjs Added functions for generating templatable PR/issue/commit creation messages
actions/setup/js/messages_core.cjs Updated JSDoc to document new message template fields
actions/setup/js/messages_footer.cjs Extended generateXMLMarker with GITHUB_RUN_ID and GH_AW_WORKFLOW_ID
actions/setup/js/generate_footer.cjs Extended generateXMLMarker with GITHUB_RUN_ID and GH_AW_WORKFLOW_ID
actions/setup/js/update_activation_comment.test.cjs Updated tests to reflect removal of emojis from default messages
actions/setup/js/generate_footer.test.cjs Added comprehensive tests for new XML marker fields
.changeset/patch-disable-activation-comments.md Added changeset documenting the patch-level change
tmp-smoke-test-22296016223.txt Smoke test file for PR validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +76 to +80
// Check if activation comments are disabled entirely
if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) {
core.info("activation-comments is disabled: skipping activation comment update");
return;
}
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test coverage for the activation-comments guard. The guard at lines 76-80 skips activation comment updates when activationComments is false, but the existing tests in update_activation_comment.test.cjs do not verify this behavior. Consider adding tests that verify:

  1. Comment updates are skipped when activationComments is set to false
  2. Comment updates proceed normally when activationComments is true or undefined
  3. The guard works correctly with both updateActivationComment and updateActivationCommentWithCommit functions

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +68
// If activation comments are disabled entirely, skip all comment updates
if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) {
core.info("activation-comments is disabled: skipping completion comment update");
return;
}
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test coverage for the activation-comments guard. The guard at lines 64-68 skips completion comment updates when activationComments is false, but there are no tests in notify_comment_error.test.cjs verifying this behavior. Consider adding tests that verify:

  1. Completion comment updates are skipped when activationComments is set to false
  2. Completion comment updates proceed normally when activationComments is true or undefined
  3. The early return at line 67 prevents unnecessary processing when activation comments are disabled

Copilot uses AI. Check for mistakes.
},
"activation-comments": {
"type": ["boolean", "string"],
"description": "When set to false or \"false\", disables all activation and fallback comments entirely (run-started, run-success, run-failure, PR/issue creation links). Supports templatable boolean values including GitHub Actions expressions (e.g. ${{ inputs.activation-comments }}). Default: true",
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema inconsistency: The schema description states "When set to false or "false"", suggesting that the string literal "false" is accepted, but the preprocessBoolFieldAsString function in pkg/workflow/templatables.go (lines 63-64) will reject any string that is not a GitHub Actions expression (must start with "${{" and end with "}}"). This means users cannot use the string "false" directly; they must use the boolean value false or a GitHub Actions expression like "${{ inputs.activation-comments }}". Either:

  1. Update the schema description to clarify that only boolean false or GitHub Actions expressions are accepted, not the string literal "false", or
  2. Modify the preprocessor to accept the string literals "true" and "false" as valid values alongside booleans and expressions.

Based on the codebase pattern, option 1 is likely the correct approach for consistency with other templatable boolean fields.

Suggested change
"description": "When set to false or \"false\", disables all activation and fallback comments entirely (run-started, run-success, run-failure, PR/issue creation links). Supports templatable boolean values including GitHub Actions expressions (e.g. ${{ inputs.activation-comments }}). Default: true",
"description": "When set to false, disables all activation and fallback comments entirely (run-started, run-success, run-failure, PR/issue creation links). Supports templatable boolean values via GitHub Actions expressions (e.g. '${{ inputs.activation-comments }}'). String values must be valid GitHub Actions expressions that resolve to a boolean at runtime. Default: true",

Copilot uses AI. Check for mistakes.
StagedTitle string `yaml:"staged-title,omitempty" json:"stagedTitle,omitempty"` // Custom styled mode title template
StagedDescription string `yaml:"staged-description,omitempty" json:"stagedDescription,omitempty"` // Custom staged mode description template
AppendOnlyComments bool `yaml:"append-only-comments,omitempty" json:"appendOnlyComments,omitempty"` // If true, post run status as new comments instead of updating the activation comment
ActivationComments string `yaml:"activation-comments,omitempty" json:"activationComments,omitempty"` // If "false", disable all activation/fallback comments entirely. Supports templatable boolean values (literal "true"/"false" or GitHub Actions expressions). Empty/unset preserves default enabled behavior.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation inconsistency: The comment states "Supports templatable boolean values (literal 'true'/'false' or GitHub Actions expressions)", but the preprocessBoolFieldAsString function (pkg/workflow/templatables.go, lines 63-64) only accepts boolean values or GitHub Actions expressions (strings starting with "${{" and ending with "}}"). String literals "true" or "false" are not accepted and will result in an error.

Update the comment to accurately reflect the accepted values: "Supports templatable boolean values (booleans or GitHub Actions expressions like '${{ inputs.activation-comments }}'). Empty/unset preserves default enabled behavior."

Suggested change
ActivationComments string `yaml:"activation-comments,omitempty" json:"activationComments,omitempty"` // If "false", disable all activation/fallback comments entirely. Supports templatable boolean values (literal "true"/"false" or GitHub Actions expressions). Empty/unset preserves default enabled behavior.
ActivationComments string `yaml:"activation-comments,omitempty" json:"activationComments,omitempty"` // If "false", disable all activation/fallback comments entirely. Supports templatable boolean values (booleans or GitHub Actions expressions like '${{ inputs.activation-comments }}'). Empty/unset preserves default enabled behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +523 to +526
"activation-comments": "false",
},
},
expected: "false",
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case inconsistency: The test "activation-comments string value is stored as-is in Messages" at lines 519-527 tests that the string literal "false" is accepted and stored. However, the preprocessBoolFieldAsString function (pkg/workflow/templatables.go, lines 63-64) will reject any string that is not a GitHub Actions expression (must start with "${{" and end with "}}"). This test will fail when the preprocessing step is executed.

Either:

  1. Update the test to use a GitHub Actions expression like "${{ inputs.activation-comments }}" instead of the string literal "false", or
  2. Remove this test case if string literals are not intended to be supported.

Based on the codebase pattern and the preprocessor implementation, option 1 is the correct approach.

Suggested change
"activation-comments": "false",
},
},
expected: "false",
"activation-comments": "${{ inputs.activation-comments }}",
},
},
expected: "${{ inputs.activation-comments }}",

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +70
// Check if activation comments are disabled
const messagesConfig = getMessages();
if (!parseBoolTemplatable(messagesConfig?.activationComments, true)) {
core.info("activation-comments is disabled: skipping activation comment creation");
return;
}
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing test coverage for the new activation-comments guard functionality. The guard at lines 65-70 skips comment creation when activationComments is false, but there are no tests in the corresponding test file verifying this behavior. Consider adding tests that verify:

  1. Comment creation is skipped when activationComments is set to false
  2. Comment creation proceeds normally when activationComments is true or undefined
  3. The parseBoolTemplatable function correctly handles string expressions like "${{ inputs.activation-comments }}"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add flag to disable activation/fallback comments

2 participants