Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

When a GitHub Actions expression in target fails to evaluate (e.g., becomes literal "event" instead of a number), safe output handlers fail silently with unclear errors. This happened when users configured target: "${{ github.event }}" which returns an object, not a number.

Changes

Enhanced error detection in safe_output_helpers.cjs:

  • Detect failed expression patterns: "event", "[object Object]", or strings containing "github.event"
  • Provide context-specific guidance based on handler support (issue-only, PR-only, or both)
  • Correctly identify item type in error messages

Before:

Invalid issue number in target configuration: event

After:

Invalid issue number in target configuration: event. It looks like the target contains a 
GitHub Actions expression that didn't evaluate correctly. Make sure you're using a proper 
expression like "${{ github.event.issue.number }}" and that the workflow is running in an 
issue context.

Test coverage:

  • Added test verifying issue-only handlers show correct guidance
  • Verified handlers supporting both issues and PRs provide both expression examples

💡 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.

Copilot AI and others added 2 commits January 21, 2026 18:23
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug issue update in agentic workflow Improve error messages for invalid target configuration in safe outputs Jan 21, 2026
Copilot AI requested a review from eaftan January 21, 2026 18:33
@eaftan eaftan marked this pull request as ready for review January 21, 2026 19:18
@pelikhan
Copy link
Contributor

@copilot format, lint js, fix tests

@pelikhan pelikhan merged commit b786b66 into main Jan 21, 2026
47 of 48 checks passed
@pelikhan pelikhan deleted the copilot/debug-issue-update-problem branch January 21, 2026 20:53
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.

3 participants