Skip to content

fix(ci): resolve upload-artifact path via github.workspace context#29

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

fix(ci): resolve upload-artifact path via github.workspace context#29
williaby merged 1 commit into
mainfrom
fix/sbom-upload-workspace-context

Conversation

@williaby
Copy link
Copy Markdown
Collaborator

Summary

In a reusable (workflow_call) workflow the runner process CWD is not guaranteed to be $GITHUB_WORKSPACE. The relative glob sbom-*.json therefore resolves to the wrong directory, confirmed failing in run 24256519203 even with the file present at $GITHUB_WORKSPACE/sbom-runtime.json.

Using ${{ github.workspace }}/sbom-*.json gives upload-artifact@v4 the workspace root as a context expression evaluated before the glob resolver runs, so the path is correct regardless of process CWD.

Diagnosis path

PR Upload path Result
#26 ${{ github.workspace }}/sbom-*.json with v4.6.2 failed — v4.6.2 glob bug
#27 ${{ github.workspace }}/sbom-*.json with v4.5.0 merged without test run
#28 sbom-*.json (relative) with v4.5.0 failed — CWD ≠ GITHUB_WORKSPACE
#29 ${{ github.workspace }}/sbom-*.json with v4.5.0 to test

The combination of v4.5.0 + ${{ github.workspace }} context path has not yet had a clean test run.

Testing

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

🤖 Generated with Claude Code

In a reusable workflow the runner process CWD is not guaranteed to be
$GITHUB_WORKSPACE, so the relative glob sbom-*.json resolves to the
wrong directory (confirmed failing in run 24256519203 even with the
file confirmed present at $GITHUB_WORKSPACE/sbom-runtime.json).

upload-artifact@v4 evaluates ${{ github.workspace }} as a workflow
context expression before the glob resolver runs, so the path
correctly expands to the workspace root regardless of the process CWD.

🤖 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

Warning

Rate limit exceeded

@williaby has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 44 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 44 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c71a2e8a-3880-4656-b669-d5c337b1f2f5

📥 Commits

Reviewing files that changed from the base of the PR and between 85da151 and 15dbde1.

📒 Files selected for processing (1)
  • .github/workflows/python-sbom.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sbom-upload-workspace-context

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 24e46da into main Apr 10, 2026
4 checks passed
@williaby williaby deleted the fix/sbom-upload-workspace-context branch April 18, 2026 21:13
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