Skip Preview workflow for Dependabot PRs (#144)

Dependabot-triggered runs read from the Dependabot secrets store, which
is empty, so the Google Cloud auth step receives an empty credential and
fails. Skip the preview job for Dependabot; CI still validates those PRs.

Also guard the PR comment step so it doesn't post 'Failed to read
preview output' when the preview step never ran.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
claude[bot] 2026-07-02 19:22:26 -07:00 • committed by GitHub
commit a4c81501ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,8 +16,8 @@ jobs:
preview:
name: Preview Changes
runs-on: ubuntu-latest
# Skip preview for fork PRs - they don't have access to secrets
if: github.event.pull_request.head.repo.full_name == github.repository
# Skip preview for fork PRs and Dependabot - they don't have access to Actions secrets
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
environment: production
steps:
- name: Checkout code
@ -101,7 +101,7 @@ jobs:
exit $PREVIEW_EXIT_CODE
- name: Comment on PR
if: always()
if: always() && steps.preview.conclusion != 'skipped'
uses: actions/github-script@v7
with:
script: |