-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (31 loc) · 1.07 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: SLSA Generator Custom NodeJS
on:
workflow_dispatch:
push:
permissions:
contents: read
id-token: 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: Build steps
run: |
echo "Building the project"
npm pack
- name: Get npm package filename
id: package-info
run: |
PACKAGE_PATH=$(ls -1 *.tgz | head -n 1) # To be change with the action as input
pack_json=$(npm pack $PACKAGE_PATH --json | tee pack.json | jq -c)
jq <pack.json
PACKAGE_FILENAME=$(echo "$pack_json" | jq -r '.[0].filename')
echo "PACKAGE_FILENAME=${PACKAGE_FILENAME}" >> $GITHUB_OUTPUT
- name: Attest for npmjs.com
uses: LedgerHQ/actions-security/actions/attest-for-npmsjs-com@feat-init-npmjs-com-action
with:
subject-path: ${{ steps.package-info.outputs.PACKAGE_FILENAME }}