Skip to content

Fix upload-asset job: Add ScriptFile support for external script loading#8465

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-upload-asset-job
Jan 1, 2026
Merged

Fix upload-asset job: Add ScriptFile support for external script loading#8465
pelikhan merged 2 commits into
mainfrom
copilot/fix-upload-asset-job

Conversation

Copilot AI commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

The upload_assets job was compiling with an empty script: | block because getUploadAssetsScript() returns an empty string after embedded scripts were removed in favor of external actions loaded via require().

Changes

pkg/workflow/publish_assets.go

  • Added ScriptName: "upload_assets" to SafeOutputJobConfig

pkg/workflow/safe_outputs_steps.go

  • Extended buildGitHubScriptStep() to support ScriptFile parameter (previously only buildGitHubScriptStepWithoutDownload() had this)
  • Added ScriptFile fallback in buildCustomActionStep() when action registry lookup fails

pkg/workflow/safe_outputs_jobs.go

  • Automatically derive ScriptFile from ScriptName in inline mode: scriptName → scriptName.cjs

Result

Workflows now generate proper require() statements instead of empty script blocks:

script: |
  const { setupGlobals } = require('/tmp/gh-aw/actions/setup_globals.cjs');
  setupGlobals(core, github, context, exec, io);
  const { main } = require('/tmp/gh-aw/actions/upload_assets.cjs');
  await main();

Affects 23 workflows using upload-asset safe output.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20641693626/job/59274444509#step:10:1

Investigate and fix upload-asset job

Custom agent used: debug-agentic-workflow
Debug and refine agentic workflows using gh-aw CLI tools - analyze logs, audit runs, and improve workflow performance


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

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate and fix upload-asset job Fix upload-asset job: Add ScriptFile support for external script loading Jan 1, 2026
Copilot AI requested a review from pelikhan January 1, 2026 17:13
@pelikhan pelikhan marked this pull request as ready for review January 1, 2026 17:14
@pelikhan pelikhan merged commit 751dde0 into main Jan 1, 2026
127 of 128 checks passed
@pelikhan pelikhan deleted the copilot/fix-upload-asset-job branch January 1, 2026 17:15
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