Skip to content

fix(release ci): fix paths for downloaded artifacts - #609

Merged
twitchyliquid64 merged 1 commit into
mainfrom
tom/mip
Jul 1, 2026
Merged

fix(release ci): fix paths for downloaded artifacts#609
twitchyliquid64 merged 1 commit into
mainfrom
tom/mip

Conversation

@twitchyliquid64

@twitchyliquid64 twitchyliquid64 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Fixes:

Post "https://uploads.github.com/repos/gominimal/minimal/releases/347232210/assets?label=&name=minimald-linux-arm64": read minimald-linux-arm64: is a directory
Error: Process completed with exit code 1.

merge-multiple makes it stamp out the artifacts all in the same dir, rather than extracting each matched artifact into its own directory.

Summary by CodeRabbit

  • Chores
    • Improved release artifact download handling so multiple matching artifacts are merged into a single destination folder during release processing.
    • Updated release asset selection to match the current build outputs, ensuring the correct files are packaged and attached to the release.
    • Linux release binaries are now renamed with platform-specific suffixes before uploading, improving consistency for downstream release steps (including shell completion generation).

@twitchyliquid64
twitchyliquid64 enabled auto-merge (squash) July 1, 2026 04:51
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The release workflow now renames Linux build outputs with platform suffixes, merges downloaded artifacts in the release job, generates completions from the suffixed amd64 binaries, and enumerates release assets with find.

Changes

CI Workflow Update

Layer / File(s) Summary
Rename Linux release binaries
.github/workflows/ci.yml
Renames amd64 and arm64 release binaries to platform-suffixed filenames before uploading them as artifacts.
Merge downloaded artifacts
.github/workflows/ci.yml
Downloads artifacts with merge-multiple: true, makes binaries executable, and generates completions from the *-linux-amd64 binaries.
Package release assets with find
.github/workflows/ci.yml
Creates artifacts/completions.tar.gz and switches release asset enumeration from ls to find . -maxdepth 1 -type f.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I hop through release with careful feet,
Suffixes and bundles now feel neat.
Completions tucked in a tarball bright,
And find gathers assets just right. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the release CI artifact path fix and matches the main change in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@twitchyliquid64
twitchyliquid64 disabled auto-merge July 1, 2026 04:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

249-268: 🗄️ Data Integrity & Integration | 🔴 Critical | 🏗️ Heavy lift

merge-multiple: true will flatten the downloads and break the release job. The files inside each artifact are still named mip, minimal, and minimald, so amd64/arm64 copies overwrite each other in artifacts/. The later chmod +x artifacts/*-*-* and completion commands still look for platform-suffixed paths, so this step will fail unless the binaries are renamed before upload or the download keeps separate subdirectories.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 249 - 268, The Download artifacts step
in the ci workflow is flattening files because merge-multiple is enabled, which
breaks the later chmod and completion generation that expect platform-suffixed
binaries. Update the artifact handling so the binaries remain in separate
subdirectories or are renamed with unique platform names before upload, and make
sure the Generate completions commands in the workflow reference the actual
downloaded paths for mip, minimal, and minimald.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 249-268: The Download artifacts step in the ci workflow is
flattening files because merge-multiple is enabled, which breaks the later chmod
and completion generation that expect platform-suffixed binaries. Update the
artifact handling so the binaries remain in separate subdirectories or are
renamed with unique platform names before upload, and make sure the Generate
completions commands in the workflow reference the actual downloaded paths for
mip, minimal, and minimald.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 696dae77-ce13-4435-ad9f-ef1884665f14

📥 Commits

Reviewing files that changed from the base of the PR and between 939afd2 and 3643529.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

249-268: 🗄️ Data Integrity & Integration | 🔴 Critical | 🏗️ Heavy lift

merge-multiple: true clobbers same-named binaries here.
Artifacts upload mip/minimal/minimald under different artifact names, so downloading them into one directory keeps only one copy of each basename and drops the arch-specific suffix. That breaks artifacts/*-*-* and artifacts/mip-linux-amd64/minimal-linux-* references, and the release assets can end up with the wrong architecture. Rename the files before upload or download each artifact into its own directory.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 249 - 268, The artifact download step
is merging multiple uploads into one directory, which causes same-named binaries
to overwrite each other and breaks the later references in the
completion-generation step. Update the workflow around the Download artifacts
and Generate completions steps so each artifact is kept in its own directory or
is renamed before download/upload, and ensure the completion commands reference
the correct unique binary paths from the intended artifact names.
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

273-278: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Static analysis flags potential template injection via unquoted ${{ }} expansion in run:.

zizmor flags this block for expanding ${{ steps.release_info.outputs.tag }} / ${{ steps.release_info.outputs.name }} directly into the shell script rather than via an env: var. These values are derived from git rev-parse --short=8 HEAD, so practical exploitability is low here, but the general pattern is unsafe if the source of these outputs ever changes to include less-trusted input.

🛡️ Suggested hardening: pass values via env instead of inline expansion
             - name: Create Release
               env:
                   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+                  RELEASE_TAG: ${{ steps.release_info.outputs.tag }}
+                  RELEASE_NAME: ${{ steps.release_info.outputs.name }}
               run: |
                   tar -C artifacts/completions -czf artifacts/completions.tar.gz .
                   cd artifacts/
-                  gh release create "${{ steps.release_info.outputs.tag }}" \
+                  gh release create "$RELEASE_TAG" \
                     $(find . -maxdepth 1 -type f) \
                     --repo="${GITHUB_REPOSITORY}" \
-                    --title="${{ steps.release_info.outputs.name }}"
+                    --title="$RELEASE_NAME"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 273 - 278, The release creation step
in the CI workflow is expanding `${{ steps.release_info.outputs.tag }}` and `${{
steps.release_info.outputs.name }}` directly inside the `run:` shell script,
which triggers template-injection hardening warnings. Update the release job to
pass these values through `env:` in the same workflow step, then reference the
environment variables in the `gh release create` command instead of inline `${{
}}` expansion; use the release-info step outputs as the source and keep the
existing `gh release create` block intact.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 249-268: The artifact download step is merging multiple uploads
into one directory, which causes same-named binaries to overwrite each other and
breaks the later references in the completion-generation step. Update the
workflow around the Download artifacts and Generate completions steps so each
artifact is kept in its own directory or is renamed before download/upload, and
ensure the completion commands reference the correct unique binary paths from
the intended artifact names.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 273-278: The release creation step in the CI workflow is expanding
`${{ steps.release_info.outputs.tag }}` and `${{ steps.release_info.outputs.name
}}` directly inside the `run:` shell script, which triggers template-injection
hardening warnings. Update the release job to pass these values through `env:`
in the same workflow step, then reference the environment variables in the `gh
release create` command instead of inline `${{ }}` expansion; use the
release-info step outputs as the source and keep the existing `gh release
create` block intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aae42e57-8fd6-405a-ba12-eb76eed03a4b

📥 Commits

Reviewing files that changed from the base of the PR and between 3643529 and fc387ed.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

300-309: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pass release tag/name via env instead of inline ${{ }} in the run script.

The asset enumeration logic is correct. Separately, ${{ steps.release_info.outputs.tag }} / .name are interpolated directly into the shell script (flagged by zizmor at Lines 306, 309). The values are SHA-derived so real risk is low here, but binding them to env and referencing shell variables avoids the template-injection class entirely and clears the SAST finding.

🔒 Proposed hardening
             - name: Create Release
               env:
                   GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+                  RELEASE_TAG: ${{ steps.release_info.outputs.tag }}
+                  RELEASE_NAME: ${{ steps.release_info.outputs.name }}
               run: |
                   tar -C artifacts/completions -czf artifacts/completions.tar.gz .
                   cd artifacts/
-                  gh release create "${{ steps.release_info.outputs.tag }}" \
+                  gh release create "$RELEASE_TAG" \
                     $(find . -maxdepth 1 -type f) \
                     --repo="${GITHUB_REPOSITORY}" \
-                    --title="${{ steps.release_info.outputs.name }}"
+                    --title="$RELEASE_NAME"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 300 - 309, The Create Release workflow
step is interpolating the release tag and title directly inside the shell
script, so move the release tag/name from steps.release_info.outputs.tag and
steps.release_info.outputs.name into env values on the Create Release step and
reference those shell variables in the gh release create command instead. Keep
the existing tar/find asset logic unchanged, and use the Create Release step
plus gh release create invocation as the place to apply the env-based
substitution.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 300-309: The Create Release workflow step is interpolating the
release tag and title directly inside the shell script, so move the release
tag/name from steps.release_info.outputs.tag and steps.release_info.outputs.name
into env values on the Create Release step and reference those shell variables
in the gh release create command instead. Keep the existing tar/find asset logic
unchanged, and use the Create Release step plus gh release create invocation as
the place to apply the env-based substitution.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb6890e6-bbd2-4f87-878b-b759d702ecaf

📥 Commits

Reviewing files that changed from the base of the PR and between fc387ed and 7dba69c.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@twitchyliquid64
twitchyliquid64 merged commit e4ff231 into main Jul 1, 2026
41 of 45 checks passed
@twitchyliquid64
twitchyliquid64 deleted the tom/mip branch July 1, 2026 05:40
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