Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

ci: Restore safe-to-deploy workflows (#6054)

Oleg Isonen50958a68b324
diff --git a/.github/actions/add-status/action.yaml b/.github/actions/add-status/action.yaml
index b90e6986a9..be931299de 100644
--- a/.github/actions/add-status/action.yaml
+++ b/.github/actions/add-status/action.yaml
@@ -15,7 +15,7 @@ runs:
using: "composite"
steps:
- name: Add URL to vercel deployment through *.prs.webstudio.is
- uses: actions/github-script@v7
+ uses: actions/github-script@v8
with:
script: |
const branch = context.payload.pull_request?.head?.ref ?? context.payload.ref?.replace('refs/heads/', '')
diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml
index d07b350c89..5cb4f7558f 100644
--- a/.github/actions/ci-setup/action.yml
+++ b/.github/actions/ci-setup/action.yml
@@ -12,8 +12,8 @@ runs:
using: "composite"
steps:
- - uses: pnpm/action-setup@v4
- - uses: actions/setup-node@v4
+ - uses: pnpm/action-setup@v6
+ - uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml
index 279d387579..8a050895ee 100644
--- a/.github/workflows/chromatic.yml
+++ b/.github/workflows/chromatic.yml
@@ -32,10 +32,11 @@ jobs:
name: development
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
fetch-depth: 2 # we need to fetch at least parent commit to satisfy Chromatic
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy' }}
# Storybook with submodules
- uses: ./.github/actions/submodules-checkout
@@ -46,7 +47,7 @@ jobs:
- name: Chromatic
id: chromatic
- uses: chromaui/[email protected]
+ uses: chromaui/action@v16
with:
projectToken: bea8dc1981d4
buildScriptName: storybook:build
diff --git a/.github/workflows/delete-github-deployments.yml b/.github/workflows/delete-github-deployments.yml
index 26860f2613..421438da96 100644
--- a/.github/workflows/delete-github-deployments.yml
+++ b/.github/workflows/delete-github-deployments.yml
@@ -17,7 +17,7 @@ jobs:
if: ${{ always() }}
steps:
- name: Delete Previous deployments
- uses: actions/github-script@v7
+ uses: actions/github-script@v8
env:
REF: ${{ inputs.ref }}
with:
diff --git a/.github/workflows/fixtures-test.yml b/.github/workflows/fixtures-test.yml
index 87d3f29b84..b855621718 100644
--- a/.github/workflows/fixtures-test.yml
+++ b/.github/workflows/fixtures-test.yml
@@ -35,7 +35,7 @@ jobs:
BUILDER_HOST: ${{ inputs.builder-host }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# Test that everything is working with submodules
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c337503a17..83784fe273 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -42,18 +42,19 @@ jobs:
runs-on: ubuntu-24.04-arm
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy' }}
# Will not checkout submodules on empty environment, and will on development
- uses: ./.github/actions/submodules-checkout
with:
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
- - uses: pnpm/action-setup@v4
+ - uses: pnpm/action-setup@v6
- - uses: actions/setup-node@v4
+ - uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
@@ -84,7 +85,7 @@ jobs:
pnpm check:generated-docs
- name: Cache Playwright browsers
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
@@ -105,15 +106,22 @@ jobs:
pnpm -r typecheck
check-size:
+ # Run on push, regular PR (for repo branches), or labeled PR with safe-to-deploy (for forks)
+ if: |
+ github.event_name == 'push' ||
+ github.event_name == 'pull_request' ||
+ (github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy')
+
runs-on: ubuntu-24.04-arm
environment:
name: development
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy' }}
- uses: ./.github/actions/submodules-checkout
with:
@@ -123,7 +131,7 @@ jobs:
- run: pnpm --filter "{./fixtures/*}..." build
- - uses: actions/github-script@v7
+ - uses: actions/github-script@v8
with:
script: |
const assertSize = async (directory, maxSize) => {
@@ -181,9 +189,10 @@ jobs:
shards: ${{ steps.shards.outputs.value }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy' }}
- uses: ./.github/actions/submodules-checkout
with:
@@ -206,10 +215,10 @@ jobs:
run: pnpm e2e:builder:refresh-schema-cache
- name: Upload builder e2e prerequisites
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v6
with:
name: builder-e2e-build
- retention-days: 1
+ retention-days: 7
path: |
apps/builder/build/server
apps/builder/build/client/assets
@@ -241,9 +250,10 @@ jobs:
BUILDER_E2E_COMPOSE_ARGS: "--env-file apps/builder/.env -f apps/builder/docker-compose.yaml -f apps/builder/docker-compose.e2e.yaml"
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy' }}
- uses: ./.github/actions/submodules-checkout
with:
@@ -254,13 +264,13 @@ jobs:
run-scripts: "true"
- name: Cache Playwright browsers
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: builder-e2e-playwright-${{ runner.os }}-${{ hashFiles('apps/builder/package.json', 'pnpm-lock.yaml') }}
- name: Download builder e2e build
- uses: actions/download-artifact@v4
+ uses: actions/download-artifact@v7
with:
name: builder-e2e-build
path: .
diff --git a/.github/workflows/vercel-deploy-staging.yml b/.github/workflows/vercel-deploy-staging.yml
index 69e4b8f534..84852255a4 100644
--- a/.github/workflows/vercel-deploy-staging.yml
+++ b/.github/workflows/vercel-deploy-staging.yml
@@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Remove safe-to-deploy label
- uses: actions/github-script@v7
+ uses: actions/github-script@v8
with:
script: |
await github.rest.issues.removeLabel({
@@ -61,17 +61,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.action == 'labeled' && github.event.label.name == 'safe-to-deploy' }}
- uses: ./.github/actions/submodules-checkout
with:
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
- - uses: pnpm/action-setup@v4
+ - uses: pnpm/action-setup@v6
- - uses: actions/setup-node@v4
+ - uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
@@ -109,7 +110,7 @@ jobs:
- name: Comment on PR with deployment URL
if: github.event_name == 'pull_request_target' && matrix.environment == 'development'
- uses: actions/github-script@v7
+ uses: actions/github-script@v8
with:
script: |
const deployUrl = 'https://${{ steps.vercel.outputs.alias }}.${{ matrix.environment }}.webstudio.is';
@@ -124,13 +125,19 @@ jobs:
builder-host: "${{ steps.vercel.outputs.alias }}.${{ matrix.environment }}.webstudio.is"
deployment-host:
+ # Run on push (for repo branches) OR on labeled event with safe-to-deploy label (for fork PRs)
+ if: |
+ github.event_name == 'push' ||
+ (github.event_name == 'pull_request_target' && github.event.action == 'labeled' && github.event.label.name == 'safe-to-deploy')
+
runs-on: ubuntu-latest
outputs:
development-builder-host: ${{ steps.host.outputs.value }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.action == 'labeled' && github.event.label.name == 'safe-to-deploy' }}
- id: host
shell: bash
diff --git a/.github/workflows/vis-reg-tests.yml b/.github/workflows/vis-reg-tests.yml
index db45a8d9c3..11e28346c6 100644
--- a/.github/workflows/vis-reg-tests.yml
+++ b/.github/workflows/vis-reg-tests.yml
@@ -38,6 +38,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
+ allow-unsafe-pr-checkout: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'safe-to-deploy' }}
- uses: ./.github/actions/ci-setup