Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces package provenance signing support and a new --package-only option to package archives without publishing them. The reviewer identified a critical issue in both the packaging and publishing steps: because runCommand is executed with the package's subdirectory as the working directory, using relative paths for the archive file will cause the commands to look for or create the archive in the wrong directory. The reviewer suggests using absolute paths (archiveFile.absolute.path) to resolve this issue.
| final result = await runCommand( | ||
| command, | ||
| args: [ | ||
| 'pub', | ||
| 'publish', | ||
| '--to-archive=${archiveFile.path}', | ||
| ], | ||
| cwd: package.directory, | ||
| ); |
There was a problem hiding this comment.
Since runCommand is executed with cwd: package.directory (which is a subdirectory in monorepos), passing the relative path archiveFile.path (e.g., output/package-version.tar.gz) will cause pub publish to write the archive inside the package's subdirectory (e.g., pkgs/package_name/output/...) instead of the repository root's output/ directory.
To ensure the archive is written to the correct location at the repository root, use archiveFile.absolute.path instead.
| final result = await runCommand( | |
| command, | |
| args: [ | |
| 'pub', | |
| 'publish', | |
| '--to-archive=${archiveFile.path}', | |
| ], | |
| cwd: package.directory, | |
| ); | |
| final result = await runCommand( | |
| command, | |
| args: [ | |
| 'pub', | |
| 'publish', | |
| '--to-archive=${archiveFile.absolute.path}', | |
| ], | |
| cwd: package.directory, | |
| ); |
| final result = await runCommand( | ||
| command, | ||
| args: [ | ||
| 'pub', | ||
| 'publish', | ||
| '--from-archive=${archiveFile.path}', | ||
| '--force', | ||
| ], | ||
| cwd: package.directory, | ||
| ); |
There was a problem hiding this comment.
Similar to the packaging step, since runCommand is executed with cwd: package.directory, passing the relative path archiveFile.path will cause pub publish to look for the archive inside the package's subdirectory (e.g., pkgs/package_name/output/...) instead of the repository root's output/ directory where it was created.
Use archiveFile.absolute.path to ensure the correct absolute path is passed to the command.
| final result = await runCommand( | |
| command, | |
| args: [ | |
| 'pub', | |
| 'publish', | |
| '--from-archive=${archiveFile.path}', | |
| '--force', | |
| ], | |
| cwd: package.directory, | |
| ); | |
| final result = await runCommand( | |
| command, | |
| args: [ | |
| 'pub', | |
| 'publish', | |
| '--from-archive=${archiveFile.absolute.path}', | |
| '--force', | |
| ], | |
| cwd: package.directory, | |
| ); |
PR HealthUnused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with |
008a952 to
8f00e63
Compare
66059b2 to
ec96d03
Compare
a5171b9 to
cf7a0c6
Compare
dc2c6be to
8ff68d9
Compare
8ff68d9 to
ca57d74
Compare
Description
Follow-up to #441: This PR integrates Anchore Syft via
anchore/sbom-actionto automatically generate an SPDX 2.3 JSON Software Bill of Materials (SBOM) from the published package dependency tree, and signs/records an SBOM Attestation with Sigstore usingactions/attest@v4.Changes:
.github/workflows/publish.yaml:Generate SBOM with Syftstep usinganchore/sbom-action@v0.24.0to generateoutput/sbom.spdx.json.Generate SBOM Attestationstep usingactions/attest@v4withsbom-path: 'output/sbom.spdx.json'.Part of the ongoing package signing and supply chain security initiative for
pub.dev.