sv-tools/Rust Metadata Action
Expose `cargo metadata` as workflow outputs: package list, publishable crates, and a per-package / per-feature job matrix.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| manifest-path | Path to the project's `Cargo.toml`. The action runs from this file's directory, so any adjacent `rust-toolchain.toml` is honored — its pinned toolchain is installed via `rustup` before metadata is read. | no | Cargo.toml |
| packages-exclude | Comma-separated list of package names to drop from the `packages` output. Independent of the other `*-exclude*` inputs. | no | "" |
| publish-exclude | Comma-separated list of package names to drop from the `publish` output. Useful for crates that are publishable per Cargo.toml but you never want this workflow to publish (e.g. mirrored or vendored copies). Independent of the other `*-exclude*` inputs. | no | "" |
| matrix-exclude-packages | Comma-separated list of package names to drop from the `matrix` output. Excluded packages may still appear in `packages` and `publish`; only matrix rows are suppressed. | no | "" |
| matrix-exclude-features | Comma-separated list of features to drop from `matrix` rows. Each entry is either `<feature>` (excluded from every package that declares it) or `<package>:<feature>` (scoped to that package). If every feature of a package is excluded, the package contributes no matrix rows at all (no bare `--package=` fallback). | no | "" |
Outputs
| name | description |
|---|---|
| metadata | Full `cargo metadata --no-deps` output as a JSON-encoded string. Use `fromJson` in workflow expressions to parse it. |
| packages | JSON-encoded array of every package name in the workspace. Example: `["foo","bar"]`. |
| publish | JSON-encoded array of package names that need to be published — i.e. their local `version` is strictly newer than what is on the registry. The action runs `cargo info` for each publishable candidate and compares versions per semver. Packages declared `publish = false` are always excluded; packages not yet on the registry are included (first publish); packages whose registry version is equal or newer are skipped. Packages restricted to a specific registry via `publish = ["my-registry"]` are queried against that registry. Example: `["foo","bar"]`. |
| matrix | JSON-encoded array of cargo argument strings — one entry per package, or one per feature for packages that declare features. Intended for `strategy.matrix`. Example: `["--package=foo","--package=bar --features=full"]`. |
| rust-version | Workspace MSRV: the highest `rust-version` declared by any package, compared numerically (so `1.10` > `1.9`). Empty string if no package declares one. Useful for `actions-rust-lang/setup-rust-toolchain`. |
| edition | The newest Rust edition used by any package in the workspace (e.g. `2021`, `2024`). Empty string for an empty workspace. |