From 84b1e3296cadb92e5ea4d067f70cb463f421b59d Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Thu, 19 Mar 2026 07:46:09 -0500 Subject: [PATCH] Fail safe manual extension diffing --- .github/workflows/ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7819ed2eb0..3a53150abdc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,8 +62,8 @@ jobs: - name: Ensure changed-scope base commit uses: ./.github/actions/ensure-base-commit with: - base-sha: ${{ github.event_name == 'push' && github.event.before || github.event.pull_request.base.sha }} - fetch-ref: ${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.base.ref }} + base-sha: ${{ github.event_name == 'push' && github.event.before || github.event_name == 'pull_request' && github.event.pull_request.base.sha || '' }} + fetch-ref: ${{ github.event_name == 'push' && github.ref_name || github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }} - name: Detect changed scopes id: scope @@ -129,9 +129,15 @@ jobs: export BASE_SHA node --input-type=module <<'EOF' import { appendFileSync } from "node:fs"; - import { listChangedExtensionIds } from "./scripts/test-extension.mjs"; + import { + listAvailableExtensionIds, + listChangedExtensionIds, + } from "./scripts/test-extension.mjs"; - const extensionIds = listChangedExtensionIds({ base: process.env.BASE_SHA, head: "HEAD" }); + const baseSha = process.env.BASE_SHA?.trim(); + const extensionIds = baseSha + ? listChangedExtensionIds({ base: baseSha, head: "HEAD" }) + : listAvailableExtensionIds(); const matrix = JSON.stringify({ include: extensionIds.map((extension) => ({ extension })) }); appendFileSync(process.env.GITHUB_OUTPUT, `has_changed_extensions=${extensionIds.length > 0}\n`, "utf8");