raz / commit 0442dd12

commit
0442dd12fd8482bbaaaa45adb9e3700718744a61
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
de634aad
ci: actions pinned by commit; only the release job may write, in a job of its own

- check job: contents read, no persisted credentials, no GH_TOKEN
  (boot fetches by curl now the repository is public)
- release job: needs check, contents write, make raz dist

patch · log

2 files changed, +25 -17

.github/workflows/ci.yml (history) modified +20 -12

@@ -1,6 +1,7 @@
11 # Checks every push to main. A pushed tag vX.Y.Z is checked too and
22 # becomes a GitHub release, with a tarball of raz, the lib/ it reads
33 # beside itself, and the manual pages. Run by hand with a tag, it releases an older tag.
4+# Actions are pinned by commit; only the release job may write.
45 name: ci
56 on:
67 push:
@@ -12,30 +13,37 @@
1213 description: the tag to release
1314 required: true
1415 permissions:
15- contents: write
16+ contents: read
17+env:
18+ TAG: ${{ inputs.tag || (github.ref_type == 'tag' && github.ref_name) || '' }}
1619 jobs:
1720 check:
1821 runs-on: ubuntu-24.04
19- env:
20- TAG: ${{ inputs.tag || (github.ref_type == 'tag' && github.ref_name) || '' }}
2122 steps:
22- - uses: actions/checkout@v4
23+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
2324 with:
2425 ref: ${{ inputs.tag || github.ref }}
2526 fetch-depth: 0 # git describe needs the tags
27+ persist-credentials: false
2628 # musl and musl-tools: test/libc over musl, and cabi with musl-gcc
2729 - run: sudo apt-get update && sudo apt-get install -y musl musl-tools
28- # src/boot.sh fetches the release BOOT names, by gh where the
29- # repository is private
3030 - run: make check
31- env:
32- GH_TOKEN: ${{ github.token }}
3331 - run: make alpine
34- - name: release
35- if: env.TAG != ''
36- env:
32+ release:
33+ needs: check
34+ if: inputs.tag || github.ref_type == 'tag'
35+ runs-on: ubuntu-24.04
36+ permissions:
37+ contents: write
38+ steps:
39+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
40+ with:
41+ ref: ${{ inputs.tag || github.ref }}
42+ fetch-depth: 0
43+ persist-credentials: false
44+ - env:
3745 GH_TOKEN: ${{ github.token }}
3846 run: |
39- make dist
47+ make raz dist
4048 gh release create "$TAG" build/raz-${TAG#v}-linux-x86_64.tar.gz --verify-tag \
4149 --title "raz ${TAG#v}" --notes "$(./raz --version)"

.github/workflows/container.yml (history) modified +5 -5

@@ -31,8 +31,8 @@
3131 run:
3232 working-directory: registry
3333 steps:
34- - uses: actions/checkout@v4
35- - uses: actions/setup-node@v4
34+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
35+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
3636 with:
3737 node-version: '24'
3838 cache: npm
@@ -44,8 +44,8 @@
4444 needs: registry
4545 runs-on: ubuntu-24.04
4646 steps:
47- - uses: actions/checkout@v4
48- - uses: actions/setup-node@v4
47+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
48+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
4949 with:
5050 node-version: '24'
5151 cache: npm
@@ -76,7 +76,7 @@
7676 fi
7777 - name: Log in for publishing
7878 if: github.event_name == 'workflow_dispatch' && inputs.publish
79- uses: docker/login-action@v3
79+ uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
8080 with:
8181 registry: ${{ vars.RAZ_REGISTRY || 'raz-registry.lucelad.workers.dev' }}
8282 username: publisher