Repository navigation
Fix upload_artifact silently succeeding when relative paths are never staged - #61431
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Absolute pre-staged paths remain job-specific, and unrelated action-pin downgrades must be reverted.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes silent upload_artifact success by resolving and validating relative paths before staging.
Changes:
- Resolves relative paths from staging or
GITHUB_WORKSPACE. - Adds regression tests for staged, missing, and workspace-relative paths.
- Also introduces unrelated Docker action-pin downgrades.
File summaries
| File | Description |
|---|---|
actions/setup/js/safe_outputs_handlers.cjs |
Adds relative-path resolution and validation. |
actions/setup/js/safe_outputs_handlers.test.cjs |
Tests the new resolution behavior. |
.github/aw/actions-lock.json |
Downgrades two Docker action pins. |
pkg/actionpins/data/action_pins.json |
Mirrors the pin downgrades. |
pkg/workflow/data/action_pins.json |
Mirrors the pin downgrades. |
Review details
Suppressed comments (3)
pkg/workflow/data/action_pins.json:139
- This unrelated change downgrades the valid
docker/setup-buildx-actionpin from v4.4.0 to v4.3.0, contrary to the repository's no-downgrade behavior (pkg/cli/update_actions_lockfile_test.go:252-315). Restore v4.4.0 and sync the generated pin catalogs.
"docker/setup-buildx-action@v4.3.0": {
"repo": "docker/setup-buildx-action",
"version": "v4.3.0",
"sha": "37fe631027851001ddb9b187196cc803df7f5f0e"
pkg/actionpins/data/action_pins.json:139
- This generated package copy also replaces the valid v4.4.0 pin with v4.3.0 even though the PR is scoped to artifact path staging. Restore the newer pin when syncing from
.github/aw/actions-lock.json.
"docker/setup-buildx-action@v4.3.0": {
"repo": "docker/setup-buildx-action",
"version": "v4.3.0",
"sha": "37fe631027851001ddb9b187196cc803df7f5f0e"
.github/aw/actions-lock.json:139
- The canonical lock file is being downgraded from the valid v4.4.0 tag to v4.3.0, which is unrelated to the artifact-handler fix and propagates into both embedded catalogs during builds. Restore v4.4.0 here before syncing generated copies.
"docker/setup-buildx-action@v4.3.0": {
"repo": "docker/setup-buildx-action",
"version": "v4.3.0",
"sha": "37fe631027851001ddb9b187196cc803df7f5f0e"
- Files reviewed: 5/5 changed files
- Comments generated: 4
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
| "docker/build-push-action@v7.3.0": { | ||
| "repo": "docker/build-push-action", | ||
| "version": "v7.4.0", | ||
| "sha": "c3c9e263c25d99ce0380d002d59b67737d91b0dc" | ||
| "version": "v7.3.0", | ||
| "sha": "53b7df96c91f9c12dcc8a07bcb9ccacbed38856a" |
| // Rewrite to staging-relative path so upload_artifact.cjs resolves it from staging. | ||
| entry.path = destName; |
| "docker/build-push-action@v7.3.0": { | ||
| "repo": "docker/build-push-action", | ||
| "version": "v7.4.0", | ||
| "sha": "c3c9e263c25d99ce0380d002d59b67737d91b0dc" | ||
| "version": "v7.3.0", | ||
| "sha": "53b7df96c91f9c12dcc8a07bcb9ccacbed38856a" |
| "docker/build-push-action@v7.3.0": { | ||
| "repo": "docker/build-push-action", | ||
| "version": "v7.4.0", | ||
| "sha": "c3c9e263c25d99ce0380d002d59b67737d91b0dc" | ||
| "version": "v7.3.0", | ||
| "sha": "53b7df96c91f9c12dcc8a07bcb9ccacbed38856a" |
|
Failed checks:
Latest blocking review points:
Run URL: https://github.com/github/gh-aw/actions/runs/35168512171 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"See Network Configuration for more information.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Addressed in |
|
@copilot this PR still needs forward progress before a maintainer can investigate quickly. The branch already includes follow-up fixes responding to the earlier review, so please request a fresh Copilot review, refresh the branch if needed, and then run the Previously raised review points that should be re-evaluated:
Run URL: https://github.com/github/gh-aw/actions/runs/35174719104 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"See Network Configuration for more information.
|
Current branch head |
|
🎉 This pull request is included in a new release. Release: |
upload_artifactreturned{"result":"success"}for relative (non-absolute) paths without ever verifying the file existed, so a workflow could reference a file that was never copied into the staging directory — nosafe-outputs-upload-artifactsartifact was produced, and every downstream signal claimed success.Root cause
uploadArtifactHandlerinactions/setup/js/safe_outputs_handlers.cjsonly validated and staged absolute paths. Relative paths — including the "workspace-relative" form documented in the tool's own JSON schema — were passed through untouched on the assumption the agent had already staged them, with no existence check performed.Fix
GITHUB_WORKSPACEand copying into staging — reusing the same symlink/sensitive-path/canonical-root checks already applied to absolute paths.file not found: ...) instead of recording the item and returning success when the path can't be found anywhere.uploadCodeCoverageHandler, which already implemented this resolution logic for the analogousupload_code_coveragetool.Tests
Updated
safe_outputs_handlers.test.cjs: replaced the test that asserted the old (buggy) silent-success behavior with cases covering already-staged relative paths, missing relative paths (with/withoutGITHUB_WORKSPACE), and workspace-relative auto-copy into staging.pr-sous-chefRun URL: https://github.com/github/gh-aw/actions/runs/35168512171
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Run: https://github.com/github/gh-aw/actions/runs/35174719104
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.