Skip to content

Commit 75e38ba

Browse files
authored
ci: harden workflow (#878)
1 parent 5fe9931 commit 75e38ba

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

.github/workflows/ci-rsc.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,26 @@ jobs:
6565
- name: install react
6666
if: ${{ matrix.react_version }}
6767
run: |
68-
sed -i "/^overrides:/a\ react: \"${{ matrix.react_version }}\"" pnpm-workspace.yaml
69-
sed -i "/^overrides:/a\ react-dom: \"${{ matrix.react_version }}\"" pnpm-workspace.yaml
70-
sed -i "/^overrides:/a\ react-server-dom-webpack: \"${{ matrix.react_version }}\"" pnpm-workspace.yaml
68+
sed -i "/^overrides:/a\ react: \"$REACT_VERSION\"" pnpm-workspace.yaml
69+
sed -i "/^overrides:/a\ react-dom: \"$REACT_VERSION\"" pnpm-workspace.yaml
70+
sed -i "/^overrides:/a\ react-server-dom-webpack: \"$REACT_VERSION\"" pnpm-workspace.yaml
7171
pnpm i --no-frozen-lockfile
72+
env:
73+
REACT_VERSION: ${{ matrix.react_version }}
7274
- run: pnpm build
7375
- name: install rolldown
7476
if: ${{ matrix.rolldown }}
7577
run: |
7678
sed -i '/^overrides:/a\ vite: "npm:rolldown-vite@latest"' pnpm-workspace.yaml
7779
pnpm i --no-frozen-lockfile
78-
- run: pnpm -C packages/plugin-rsc exec playwright install ${{ matrix.browser }}
79-
- run: pnpm -C packages/plugin-rsc test-e2e-ci --project=${{ matrix.browser }}
80+
- run: pnpm -C packages/plugin-rsc exec playwright install "$BROWSER_NAME"
81+
shell: bash
82+
env:
83+
BROWSER_NAME: ${{ matrix.browser }}
84+
- run: pnpm -C packages/plugin-rsc test-e2e-ci --project="$BROWSER_NAME"
85+
shell: bash
86+
env:
87+
BROWSER_NAME: ${{ matrix.browser }}
8088
- uses: actions/upload-artifact@v4
8189
if: always()
8290
with:

.github/workflows/publish.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
with:
2525
node-version: 22
2626
registry-url: https://registry.npmjs.org/
27+
# disable cache, to avoid cache poisoning (https://docs.zizmor.sh/audits/#cache-poisoning)
28+
package-manager-cache: false
29+
30+
- name: Disallow installation scripts
31+
run: yq '.onlyBuiltDependencies = []' -i pnpm-workspace.yaml
2732

2833
- name: Install deps
2934
run: pnpm install
@@ -59,7 +64,7 @@ jobs:
5964
tag-name: ${{ github.ref_name }}
6065

6166
- if: steps.tag.outputs.isAlpha == 'false' && steps.tag.outputs.pkgName == 'plugin-rsc'
62-
uses: yyx990803/release-tag@master
67+
uses: yyx990803/release-tag@8cccf7c5aa332d71d222df46677f70f77a8d2dc0 # v1.0.0
6368
env:
6469
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6570
with:

.github/workflows/release-continuous.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ jobs:
2626
- uses: actions/setup-node@v5
2727
with:
2828
node-version: lts/*
29+
# disable cache, to avoid cache poisoning (https://docs.zizmor.sh/audits/#cache-poisoning)
30+
package-manager-cache: false
31+
32+
- name: Disallow installation scripts
33+
run: yq '.onlyBuiltDependencies = []' -i pnpm-workspace.yaml
2934

3035
- name: Install dependencies
3136
run: pnpm install

0 commit comments

Comments
 (0)