diff --git a/.github/actions/percy-exec/action.yml b/.github/actions/percy-exec/action.yml index e1c25d5a7d..30e3a5e581 100644 --- a/.github/actions/percy-exec/action.yml +++ b/.github/actions/percy-exec/action.yml @@ -28,6 +28,7 @@ runs: env: PERCY_TOKEN: ${{ inputs.percy-token }} PERCY_BROWSER_EXECUTABLE: ${{ inputs.browser-executable }} + PERCY_COMMAND: ${{ inputs.command }} run: | # Percy otherwise downloads its own Chromium from storage.googleapis.com # on the first snapshot. That download stalls in CI, which blocks the @@ -39,12 +40,14 @@ runs: export PERCY_BROWSER_EXECUTABLE fi echo "PERCY_BROWSER_EXECUTABLE=${PERCY_BROWSER_EXECUTABLE:-}" - npx percy exec -- ${{ inputs.command }} + npx percy exec -- bash -c "$PERCY_COMMAND" - name: Run without Percy (fork PR) if: inputs.percy-token == '' shell: bash working-directory: ${{ inputs.working-directory }} + env: + PERCY_COMMAND: ${{ inputs.command }} run: | echo "::notice::Skipping Percy (no token available - likely a fork PR)" - ${{ inputs.command }} + bash -c "$PERCY_COMMAND" diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index c1d6e35b19..1071928cda 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -203,12 +203,14 @@ jobs: - name: Open baseline update PR env: GH_TOKEN: ${{ github.token }} + RUN_ID: ${{ github.run_id }} + REF_NAME: ${{ github.ref_name }} run: | if git diff --quiet -- benchmarks/baseline.json; then echo "Baseline unchanged; nothing to commit." exit 0 fi - branch="benchmarks/regenerate-baseline-${{ github.run_id }}" + branch="benchmarks/regenerate-baseline-${RUN_ID}" git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git switch -c "$branch" @@ -227,7 +229,7 @@ jobs: echo "" } > "$RUNNER_TEMP/pr-body.md" gh pr create \ - --base "${{ github.ref_name }}" \ + --base "$REF_NAME" \ --head "$branch" \ --title "Regenerate benchmark baseline on CI hardware" \ --body-file "$RUNNER_TEMP/pr-body.md"