Write HTML. Render video. Built for agents.
JavaScript aiai-agentsanimationclaude-codeffmpegframeworkgsaphtmlhtml-to-videomcpmotion-graphicspuppeteerrenderingtypescriptvideo-editor
fix(ci): harden GitHub Actions workflows against supply chain attacks (#740)
Miguel Ángel8986ab2739fb
diff --git a/.github/workflows/catalog-previews.yml b/.github/workflows/catalog-previews.ymlindex adcfd102b6..ec57ae4200 100644--- a/.github/workflows/catalog-previews.yml+++ b/.github/workflows/catalog-previews.yml@@ -1,5 +1,8 @@name: Catalog Previews+permissions:+ contents: read+on:pull_request:branches: [main]@@ -39,9 +42,10 @@ jobs:chrome-version: stable- name: Render changed block/component previews+ env:+ BASE_SHA: ${{ github.event.pull_request.base.sha }}run: |# Find which blocks/components changed in this PR- BASE_SHA=${{ github.event.pull_request.base.sha }}CHANGED_ITEMS=$(git diff --name-only --diff-filter=ACMR "$BASE_SHA"...HEAD -- registry/blocks/ registry/components/ \| grep -E '^registry/(blocks|components)/' \| sed 's|^registry/[^/]*/\([^/]*\)/.*|\1|' \diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex f912bbc1f9..319c51ec86 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -1,5 +1,9 @@name: CI+permissions:+ contents: read+ pull-requests: read+on:pull_request:# `edited` is required so the workflow re-fires when a PR's base ref is@@ -224,11 +228,11 @@ jobs:runs-on: ubuntu-latesttimeout-minutes: 25steps:- - uses: actions/checkout@v4+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4with:lfs: true- - uses: oven-sh/setup-bun@v2- - uses: actions/setup-node@v4+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4with:node-version: 22- name: Install FFmpegdiff --git a/.github/workflows/docs.yml b/.github/workflows/docs.ymlindex 9aa60fa710..20c18f9066 100644--- a/.github/workflows/docs.yml+++ b/.github/workflows/docs.yml@@ -1,5 +1,8 @@name: Docs+permissions:+ contents: read+on:pull_request:branches: [main]diff --git a/.github/workflows/player-perf.yml b/.github/workflows/player-perf.ymlindex c146665ee6..9c4e0532a5 100644--- a/.github/workflows/player-perf.yml+++ b/.github/workflows/player-perf.yml@@ -1,5 +1,8 @@name: Player perf+permissions:+ contents: read+on:pull_request:push:diff --git a/.github/workflows/preview-regression.yml b/.github/workflows/preview-regression.ymlindex 748b4f2ce8..e4a56c52e9 100644--- a/.github/workflows/preview-regression.yml+++ b/.github/workflows/preview-regression.yml@@ -1,5 +1,8 @@name: preview-regression+permissions:+ contents: read+on:pull_request:push:diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.ymlindex c26a455129..6b01b164be 100644--- a/.github/workflows/publish.yml+++ b/.github/workflows/publish.yml@@ -1,5 +1,7 @@name: Publish to npm+permissions: {}+on:push:tags:@@ -42,14 +44,18 @@ jobs:- name: Resolve versionid: version+ env:+ EVENT_NAME: ${{ github.event_name }}+ INPUT_VERSION: ${{ inputs.version }}+ PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}run: |- if [ "${{ github.event_name }}" = "push" ]; then+ if [ "$EVENT_NAME" = "push" ]; thenVERSION="${GITHUB_REF_NAME#v}"- elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then- VERSION="${{ inputs.version }}"+ elif [ "$EVENT_NAME" = "workflow_dispatch" ]; then+ VERSION="${INPUT_VERSION}"VERSION="${VERSION#v}"else- BRANCH="${{ github.event.pull_request.head.ref }}"+ BRANCH="${PR_HEAD_REF}"VERSION="${BRANCH#release/v}"fiecho "version=${VERSION}" >> "$GITHUB_OUTPUT"@@ -75,9 +81,11 @@ jobs:- name: Create release tagif: github.event_name == 'pull_request'+ env:+ VERSION: ${{ steps.version.outputs.version }}run: |- git tag "v${{ steps.version.outputs.version }}"- git push origin "v${{ steps.version.outputs.version }}"+ git tag "v$VERSION"+ git push origin "v$VERSION"- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4with:@@ -92,9 +100,9 @@ jobs:- name: Publish packagesenv:NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}+ VERSION: ${{ steps.version.outputs.version }}+ DIST_TAG: ${{ steps.version.outputs.dist_tag }}run: |- VERSION="${{ steps.version.outputs.version }}"- DIST_TAG="${{ steps.version.outputs.dist_tag }}"FAILED=0publish_pkg() {@@ -153,14 +161,15 @@ jobs:- name: Create GitHub Releaseenv:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ VERSION: ${{ steps.version.outputs.version }}+ PRERELEASE: ${{ steps.version.outputs.prerelease }}+ REPO: ${{ github.repository }}run: |- VERSION="${{ steps.version.outputs.version }}"- PRERELEASE="${{ steps.version.outputs.prerelease }}"# Skip if release already exists (idempotent re-runs)- if gh release view "v${VERSION}" --repo "${{ github.repository }}" >/dev/null 2>&1; then+ if gh release view "v${VERSION}" --repo "$REPO" >/dev/null 2>&1; thenecho "Release v${VERSION} already exists — skipping"else- FLAGS=(--repo "${{ github.repository }}" --title "v${VERSION}" --generate-notes)+ FLAGS=(--repo "$REPO" --title "v${VERSION}" --generate-notes)if [ "$PRERELEASE" = "true" ]; thenFLAGS+=(--prerelease)fidiff --git a/.github/workflows/regression.yml b/.github/workflows/regression.ymlindex c887a752e1..b2a1c84504 100644--- a/.github/workflows/regression.yml+++ b/.github/workflows/regression.yml@@ -1,5 +1,8 @@name: regression+permissions:+ contents: read+on:pull_request:push:diff --git a/.github/workflows/windows-render.yml b/.github/workflows/windows-render.ymlindex 0a7db07d66..7eb8d0b2a2 100644--- a/.github/workflows/windows-render.yml+++ b/.github/workflows/windows-render.yml@@ -1,5 +1,8 @@name: Windows render verification+permissions:+ contents: read+# Manually triggered smoke test that renders a HyperFrames composition on a# real Windows runner. Proves the PR #336 `where ffmpeg` fix actually works# end-to-end: FFmpeg is discovered natively on Windows, Chrome is installed