8000
Skip to content

fix: restore actions/setup in upload_assets job after git branch switch (dev mode)#23604

Merged
pelikhan merged 1 commit intomainfrom
copilot/fix-dev-model-post-action
Mar 30, 2026
Merged

fix: restore actions/setup in upload_assets job after git branch switch (dev mode)#23604
pelikhan merged 1 commit intomainfrom
copilot/fix-dev-model-post-action

Conversation

Copy link
Copy Markdown
Contributor
Copilot AI commented Mar 30, 2026

In dev mode, the upload_assets job uses ./actions/setup as a local action, so actions/setup/action.yml lives in the workspace. The job then switches the workspace to the orphaned assets/ branch via git checkout -B, which removes all regular repo files — including action.yml. The GitHub Actions runner's post-step for Setup Scripts then fails: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '.../actions/setup'.

Changes

  • pkg/workflow/publish_assets.go — adds generateRestoreActionsSetupStep() as a PostStep in buildUploadAssetsJob when c.actionMode.IsDev(). This sparse-checks out only actions/setup back into the workspace with if: always(), ensuring the post-action can always find action.yml and complete its /tmp/gh-aw cleanup.

This is the same pattern already applied in repo_memory.go and compiler_safe_outputs_job.go for the same class of problem.

  • 24 recompiled .lock.yml files — all workflows using the upload-asset safe output now include the restore step at the end of their upload_assets job:
- name: Restore actions folder
  if: always()
  uses: actions/checkout@... # v6.0.2
  with:
    repository: github/gh-aw
    sparse-checkout: |
      actions/setup
    sparse-checkout-cone-mode: true
    persist-credentials: false

@pelikhan pelikhan marked this pull request as ready for review March 30, 2026 23:47
Copilot AI review requested due to automatic review settings March 30, 2026 23:47
@pelikhan pelikhan merged commit a299129 into main Mar 30, 2026
101 of 150 checks passed
@pelikhan pelikhan deleted the copilot/fix-dev-model-post-action branch March 30, 2026 23:47
Copy link
Copy Markdown
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

Restores the local ./actions/setup action directory in upload_assets jobs after switching the workspace to an orphan assets/ branch in dev mode, preventing GitHub Actions runner post-step failures.

Changes:

  • Add a dev-mode PostSteps restore checkout (actions/setup via sparse checkout) to the generated upload_assets job.
  • Recompile workflow .lock.yml files so upload_assets jobs include the “Restore actions folder” step at the end.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/workflow/publish_assets.go Adds a dev-mode post-step to restore actions/setup after the assets-branch checkout.
.github/workflows/weekly-issue-summary.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/weekly-editors-health-check.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/unbloat-docs.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/technical-doc-writer.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/stale-repo-identifier.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/python-data-charts.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/portfolio-analyst.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/poem-bot.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/org-health-report.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/github-mcp-structural-analysis.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/docs-noob-tester.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/deep-report.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-repo-chronicle.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-performance-summary.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-news.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-multi-device-docs-tester.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-issues-report.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-integrity-analysis.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-firewall-report.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-copilot-token-report.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/daily-code-metrics.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/copilot-session-insights.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Appends “Restore actions folder” step to upload_assets job.
.github/workflows/audit-workflows.lock.yml Appends “Restore actions folder” step to upload_assets job.

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

Comment on lines +155 to +159
var postSteps []string
if c.actionMode.IsDev() {
postSteps = append(postSteps, c.generateRestoreActionsSetupStep())
publishAssetsLog.Print("Added restore actions folder step to upload_assets job (dev mode)")
}
Copy link
Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The new dev-mode behavior appends a "Restore actions folder" post-step, but there’s no unit test coverage asserting that this step is (a) present in dev mode and (b) omitted in non-dev modes. Please extend the existing publish_assets tests to validate the generated job steps include this restore checkout when actionMode=dev, and do not include it for release/actio 8000 n/script modes.

Copilot uses AI. Check for mistakes.
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

0