Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Coding agent has begun work on fix: separate consol... and will update this pull request as work progresses.

Original prompt

fix: separate console output from GitHub Actions outputs to prevent formatting errors

Problem

The scripts/generate-outputs.sh script is currently writing formatted console messages (with emojis and labels) directly to $GITHUB_OUTPUT, causing GitHub Actions workflows to fail with:

##[error]Unable to process file command 'output' successfully.
##[error]Invalid format '🔍   Formatted tags: wgtechlabs/unthread-webhook-server:dev-a7ba114,...'

Root Cause

The script echoes user-friendly debug messages (e.g., "🔍 Formatted tags:", "ℹ️ Processing image tags...") to $GITHUB_OUTPUT when it should only write raw key-value pairs without any formatting.

Solution Required

In scripts/generate-outputs.sh and any other scripts writing to $GITHUB_OUTPUT:

  1. Separate console output from GitHub Actions outputs:

    • Console output (user messages): Use echo "message" (goes to stdout/logs only)
    • GitHub Actions outputs: Use echo "key=value" >> $GITHUB_OUTPUT (machine-readable only, no formatting)
  2. Remove all formatting from $GITHUB_OUTPUT writes:

    • ❌ Bad: echo "🔍 Formatted tags: $tags" >> $GITHUB_OUTPUT
    • ✅ Good (console): echo "🔍 Formatted tags: $tags"
    • ✅ Good (output): echo "image-tags=$tags" >> $GITHUB_OUTPUT
  3. Ensure all outputs are clean:

    • image-tags should only contain comma-separated tags
    • build-digest should only contain the SHA256 hash
    • registry-urls should only contain clean URLs
    • No emojis, labels, or formatting in any $GITHUB_OUTPUT writes

Expected Behavior After Fix

  • Users see nicely formatted messages with emojis in workflow logs (stdout)
  • GitHub Actions receives clean key=value pairs in $GITHUB_OUTPUT
  • All workflows using this action complete successfully
  • PR comments and other features work as intended

Files to Fix

  • scripts/generate-outputs.sh - Primary file with the issue
  • Any other script that writes to $GITHUB_OUTPUT or $GITHUB_STEP_SUMMARY

Testing

Please verify:

  • Workflow runs complete without "Invalid format" errors
  • GitHub Actions outputs contain only clean values (no emojis/labels)
  • Console logs still show user-friendly formatted messages
  • All action features (PR comments, outputs, etc.) work correctly

Reproduction Repository: https://github.com/wgtechlabs/unthread-webhook-server
Failed Workflow Run: https://github.com/wgtechlabs/unthread-webhook-server/actions/runs/19667665204/job/56328480450

This fix will enable the action to work properly in all consuming repositories.

Created from VS Code via the GitHub Pull Request extension.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Member

Closing this PR as it was created in the wrong repository. The fix needs to be applied to wgtechlabs/container-build-flow-action instead.

Copilot AI requested a review from warengonzaga November 25, 2025 11:25
@warengonzaga warengonzaga deleted the copilot/fix-console-output-formatting branch November 25, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants