Skip to content

fix(ci): use relative path for upload-artifact glob#28

Merged
williaby merged 1 commit into
mainfrom
fix/sbom-upload-relative-path
Apr 10, 2026
Merged

fix(ci): use relative path for upload-artifact glob#28
williaby merged 1 commit into
mainfrom
fix/sbom-upload-relative-path

Conversation

@williaby
Copy link
Copy Markdown
Collaborator

@williaby williaby commented Apr 10, 2026

Summary

upload-artifact@v4 requires a workspace-relative path. The absolute ${{ github.workspace }}/sbom-*.json introduced in #26 caused the upload to fail even though the file existed at that exact path — confirmed by the Verify step in run 24256290551:

GITHUB_WORKSPACE  : /home/runner/work/.claude/.claude
sbom-*.json files :
  354171  20 -rw-r--r-- 1 runner runner 17768 Apr 10 17:48
    /home/runner/work/.claude/.claude/sbom-runtime.json

path: /home/runner/work/.claude/.claude/sbom-*.json
##[error] No files were found with the provided path:
  /home/runner/work/.claude/.claude/sbom-*.json

The action resolves globs from $GITHUB_WORKSPACE by default, so the bare relative glob is correct.

Changes

  • path: ${{ github.workspace }}/sbom-*.jsonpath: sbom-*.json

Testing

  • Trigger the SBOM workflow and confirm upload succeeds
  • Confirm scan-runtime and license-compliance jobs receive the artifact

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated artifact upload configuration in the build process.

upload-artifact@v4 requires a workspace-relative path. The absolute
\${{ github.workspace }}/sbom-*.json prefix introduced in #26 was
causing "No files were found" even though the file existed at that
path (confirmed by the Verify step in run 24256290551). The action
resolves globs from \$GITHUB_WORKSPACE by default, so the bare
relative glob sbom-*.json is correct.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac4aa273-bc1e-4e06-8d72-aabcf0c8ab1c

📥 Commits

Reviewing files that changed from the base of the PR and between f61402a and 9808621.

📒 Files selected for processing (1)
  • .github/workflows/python-sbom.yml

📝 Walkthrough

Walkthrough

The workflow configuration for SBOM artifact generation was updated to change the upload path from an absolute workspace reference to a relative glob pattern, affecting how files are matched during artifact upload.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/python-sbom.yml
Modified the artifact upload path from ${{ github.workspace }}/sbom-*.json (absolute) to sbom-*.json (relative glob), altering the file matching behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A humble hop through workflows so fine,
From absolute paths to relative lines,
The SBOM now dances with glob so bright,
One tiny change, but oh what a sight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: switching to a relative path for the upload-artifact glob in CI configuration.
Description check ✅ Passed The description provides clear context, explains the problem with the absolute path, documents the specific change, and lists testing steps, though the PR description template sections are not formally structured.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sbom-upload-relative-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@williaby williaby merged commit 85da151 into main Apr 10, 2026
4 checks passed
@williaby williaby deleted the fix/sbom-upload-relative-path branch April 18, 2026 21:13
williaby added a commit that referenced this pull request May 17, 2026
* fix(reuse): use Docker image for SPDX generation (#124)

The reuse-compliance reusable workflow was exiting 1 even when `reuse lint`
reported full compliance. The actual failure was in the Generate SPDX SBOM
step, which ran `uv pip install --no-build 'reuse==5.0.2'`. PyPI publishes
only one wheel per reuse release (5.0.2 is cp313-only, 6.2.0 is cp310-only),
the runner's uv venv defaults to system CPython 3.12, no wheel matches, and
`--no-build` (S8541/S8544 mitigation from PR #110) forbids the sdist fallback.

Replace the uv-based install with a second invocation of fsfe/reuse-action,
passing `args: spdx -o reuse-spdx.spdx`. The Docker image already has reuse
installed for the correct Python ABI, so the wheel mismatch goes away, and
the security posture is preserved (no host-side pip install).

While here:
- Gate the Upload SPDX artifact step on the SPDX step outcome so an
  upload-of-missing-file does not mask the real failure.
- Move the `steps.reuse.outcome` shell interpolation in the Summary step
  into an env var, eliminating the workflow-injection antipattern.
- Add SPDX step outcome to the Summary so a future SPDX failure is reported
  separately from REUSE compliance status.

Refs: ByronWilliamsCPA/audio-processor PR #28, run 25982739523

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(reuse): distinguish SPDX skipped, upload-failed, and failed outcomes

The Summary step previously gated the success message on
`SPDX_OUTCOME == success` alone, so an artifact upload failure was
silently presented as a successful upload, and a skipped SPDX step
(triggered when REUSE lint fails with `fail-on-missing: true` and the
job aborts before SPDX runs) was reported as "SPDX SBOM generation
failed (outcome: skipped)", sending operators to debug a step that
never ran.

Address both Copilot findings on PR #125:

- Add `id: upload-spdx` to the Upload SPDX artifact step and thread
  `UPLOAD_OUTCOME` into the Summary step's env block.
- Split the SPDX status line into four explicit branches:
  success+uploaded (happy path), success+upload-failed (artifact is
  missing), skipped (no SPDX failure to investigate), and any other
  outcome (genuine generation failure).

Also document the intentional `fail-on-missing: false` behavior with
an `#ASSUME` comment: SPDX still runs against a possibly non-compliant
tree because the SBOM is for transparency, not for gating, and a
partial inventory beats none.

Refs: ByronWilliamsCPA/.github PR #125 (review comments)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(changelog): add Unreleased Fixed entry for python-reuse SPDX fix (#124)

Per global CLAUDE.md, `fix:` commits must add a CHANGELOG entry. The
parent commit on this branch (ed595aa, "fix(reuse): use Docker image
for SPDX generation") shipped without one. Backfill the bullet here
under [Unreleased] -> ### Fixed, alongside the related #110 entry,
covering: the Docker-image SPDX generation switch, the wheel-ABI
root cause it solved, the gated upload step, the workflow-injection
mitigation (env-var pass-through), the four-way SPDX status split
landed in c9f1127, and the documented `fail-on-missing: false`
behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant