Skip to content

Commit 7dbd8eb

Browse files
authored
docs: Add README for secure-package-download (#2608)
Fixes #2530 --------- Signed-off-by: Ian Lewis <[email protected]>
1 parent d24abf9 commit 7dbd8eb

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# secure-package-download
2+
3+
the `actions/nodejs/secure-package-download` action provides a way to
4+
download the Node.js package tarball generated by the [Node.js
5+
builder](../../../internal/builders/nodejs/README.md). The package can then
6+
be used to publish the package or upload to a secondary storage.
7+
8+
## Example
9+
10+
```yaml
11+
jobs:
12+
build:
13+
permissions:
14+
id-token: write
15+
contents: read
16+
actions: read
17+
if: startsWith(github.ref, 'refs/tags/')
18+
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
19+
with:
20+
run-scripts: "ci, build"
21+
22+
download:
23+
needs: [build]
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Download tarball
27+
uses: slsa-framework/slsa-github-generator/actions/nodejs/[email protected]
28+
with:
29+
name: ${{ needs.build.outputs.package-download-name }}
30+
path: ${{ needs.build.outputs.package-name }}
31+
sha256: ${{ needs.build.outputs.package-download-sha256 }}
32+
```
33+
34+
This will download the package tarball to `<GITHUB_WORKSPACE>/<tarball file name>`.
35+
36+
See [Custom Publishing](../../../internal/builders/nodejs/README.md#custom-publishing) for
37+
a full example of publishing using a custom tool.
38+
39+
## Inputs
40+
41+
| Name | Required | Default | Description |
42+
| -------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
43+
| `name` | yes | | The GitHub Actions workflow run artifact name. Note that this is a name given to an upload, not the path or filename |
44+
| `path` | no | "." | The path to download the tarball into. Must be under the `GITHUB_WORKSPACE` |
45+
| `sha256` | yes | | The SHA256 of the artifact for verification |
46+
47+
## Outputs
48+
49+
There are no outputs.

internal/builders/nodejs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ file. Currently [npm], [lerna] or [pnpm] can support this.
220220

221221
See the full documentation for the
222222
[`secure-attestations-download` action](../../../actions/nodejs/secure-attestations-download/README.md)
223+
and
224+
[`secure-package-download` action](../../../actions/nodejs/secure-package-download/README.md)
223225
for more information.
224226

225227
### Referencing the Node.js builder

0 commit comments

Comments
 (0)