Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 13, 2025

The compute-text step was being generated for all workflows regardless of whether ${{ needs.task.outputs.text }} was actually used in the workflow content. This resulted in unnecessary GitHub Actions steps and action files being created.

Changes

  • Detection Logic: Added detectTextOutputUsage() function that scans the markdown content for ${{ needs.task.outputs.text }} usage
  • Conditional Generation: Modified buildTaskJob() to only include the compute-text step when the text output is actually needed
  • Conditional Action Creation: Updated writeComputeTextAction() to only create the .github/actions/compute-text/action.yml file when required
  • Tracking Field: Added NeedsTextOutput boolean field to WorkflowData struct to track usage across the compilation process

Behavior

Before: All workflows generated the compute-text step and action file:

- name: Compute current body text
  id: compute-text
  uses: ./.github/actions/compute-text

After: Only workflows using ${{ needs.task.outputs.text }} generate the compute-text step:

# This will NOT generate compute-text step
Generate a weekly report based on repository analysis.

# This WILL generate compute-text step  
Analyze this content: "${{ needs.task.outputs.text }}"

Validation

  • Existing workflows (weekly-research.md, test-codex.md) now correctly skip compute-text generation since they don't use the text output
  • Workflows that do use ${{ needs.task.outputs.text }} still correctly generate the compute-text step and action file
  • Added comprehensive tests covering both scenarios and edge cases
  • All existing tests continue to pass

This optimization reduces unnecessary GitHub Actions overhead for workflows that don't need contextual text processing.

Fixes #20.

Warning

Firewall rules blocked me from connecting to one or more addresses

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

  • api.contoso.com
    • Triggering command: /tmp/go-build2408613569/b255/cli.test -test.testlogfile=/tmp/go-build2408613569/b255/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build1412393288/b255/cli.test -test.testlogfile=/tmp/go-build1412393288/b255/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build3186554237/b255/cli.test -test.testlogfile=/tmp/go-build3186554237/b255/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

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


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] the compute-text step should only be lazily inserted Make compute-text step lazily inserted only when needed Aug 13, 2025
Copilot AI requested a review from pelikhan August 13, 2025 05:12
Copilot finished work on behalf of pelikhan August 13, 2025 05:12
@pelikhan pelikhan marked this pull request as ready for review August 13, 2025 05:15
@pelikhan pelikhan merged commit fa04265 into main Aug 13, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/fix-20 branch August 13, 2025 05:16
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.

the compute-text step should only be lazily inserted

2 participants