Skip to content

Fix trunk-upgrade workflow: run upgrade within trunk-action lifecycle - #249

Merged
Morgy93 merged 6 commits into
mainfrom
copilot/fix-upgrade-job-failure
Aug 25, 2026
Merged

Morgy93 merged 6 commits into
mainfrom
copilot/fix-upgrade-job-failure

Conversation

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Original:
The upgrade job in the Trunk Upgrade workflow fails because it invokes ${TRUNK_PATH} in a later shell step after trunk-action has cleaned up its temp install path. This change moves the upgrade execution into the action step so the binary is still valid when called.

  • Root cause

    • trunk-action provisions Trunk in a temporary location and cleans it up at step completion.
    • A subsequent run: "${TRUNK_PATH}" ... step can resolve to a non-existent path (No such file or directory).
  • Workflow change

    • Updated .github/workflows/trunk-upgrade.yml to run upgrade via trunk-action input arguments instead of a separate shell step.
    • Kept token wiring on the Trunk step (GITHUB_TOKEN) so upgrade requests remain authenticated.
  • Resulting execution model

    • Upgrade now executes inside the same action invocation that owns the Trunk binary lifecycle.
    • Eliminates dependency on cross-step reuse of ephemeral TRUNK_PATH.
- name: Install Trunk CLI
  uses: trunk-io/trunk-action@... # v1.3.1
  with:
    arguments: upgrade -y --include-cli
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Actual:
This pull request updates the Trunk CLI installation step in the .github/workflows/trunk-upgrade.yml workflow to streamline the upgrade process. The main change is moving the Trunk CLI and linters upgrade command into the post-init parameter of the trunk-io/trunk-action, eliminating the need for a separate upgrade step.

Workflow improvements:

  • .github/workflows/trunk-upgrade.yml: Moved the Trunk CLI and linters upgrade command to the post-init parameter of the trunk-io/trunk-action step, and removed the separate upgrade step. This simplifies the workflow and ensures upgrades happen immediately after installation.

Co-authored-by: Morgy93 <7961978+Morgy93@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions job 'upgrade' Fix trunk-upgrade workflow: run upgrade within trunk-action lifecycle Aug 24, 2026
Copilot AI requested a review from Morgy93 August 24, 2026 07:16
@Morgy93

Morgy93 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

@copilot please rebase

Co-authored-by: Morgy93 <7961978+Morgy93@users.noreply.github.com>

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please rebase

Updated with latest main and resolved the workflow conflict in commit dc9a698, while keeping the Trunk upgrade fix in place.

@Morgy93
Morgy93 marked this pull request as ready for review August 24, 2026 07:27
Copilot AI lite review requested due to automatic review settings August 24, 2026 07:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix the scheduled “Trunk Upgrade” workflow by ensuring the Trunk binary is invoked while it still exists (i.e., within the lifecycle of trunk-io/trunk-action), avoiding failures caused by ${TRUNK_PATH} pointing to a cleaned-up temp install.

Changes:

  • Moves the intended trunk upgrade -y --include-cli execution into the trunk-io/trunk-action step configuration (instead of a later shell step).
  • Removes the separate shell step that invoked "${TRUNK_PATH}" ... after the action finished.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/trunk-upgrade.yml Outdated
Co-authored-by: Morgy93 <7961978+Morgy93@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 24, 2026 07:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .github/workflows/trunk-upgrade.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 24, 2026 08:20
@github-actions github-actions Bot added the CI/CD label Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .github/workflows/trunk-upgrade.yml
Co-authored-by: Morgy93 <7961978+Morgy93@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 24, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .github/workflows/trunk-upgrade.yml
@Morgy93
Morgy93 merged commit 7ffab46 into main Aug 25, 2026
21 checks passed
@Morgy93
Morgy93 deleted the copilot/fix-upgrade-job-failure branch August 25, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants