Skip to content

use pack to compute integrity #55

use pack to compute integrity

use pack to compute integrity #55

name: Github Attest - Custom Predicate
on:
workflow_dispatch:
push:
permissions:
contents: read
id-token: write
attestations: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
- name: Generate dummy package
run: npm pack
- uses: actions/attest@v1
id: attest
with:
subject-path: 'aenguerrand-examplepackage12-0.4.0.tgz'
subject-name: 'pkg:npm/%40aenguerrand/[email protected]'
predicate-type: 'https://slsa.dev/provenance/v0.2'
predicate: '{"builder":{"id":"https://github.com/slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@refs/tags/v2.0.0"}}'
- name: Upload artifact (build)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: aenguerrand-examplepackage12-0.4.0.tgz
path: aenguerrand-examplepackage12-0.4.0.tgz
- name: Upload artifact (build)
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
with:
name: attestation.jsonl
path: ${{ steps.attest.outputs.bundle-path }}
- name: Upload to npmjs.com
run: |
npm config set //registry.npmjs.org/:_authToken "${{ secrets.NPM_TOKEN }}"
npm publish aenguerrand-examplepackage12-0.4.0.tgz --access public --provenance-file ${{ steps.attest.outputs.bundle-path }} --access public