Skip to content

Commit 1548dea

Browse files
committed
build(ci) dependabot workflows are run in a special context as a forked PR. Due security reasons it does not have access to the secrets from the base branch. Disable build steps if the github actor is dependeabot
1 parent 47f839c commit 1548dea

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 #v6.0.3
1414
with:
15-
fetch-depth: 0
16-
lfs: true
15+
fetch-depth: ${{ github.actor == 'dependabot[bot]' && 1 || 0 }}
16+
lfs: ${{ github.actor != 'dependabot[bot]' }}
1717

1818
- name: Setup pnpm
1919
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 #v6.0.9
@@ -31,6 +31,7 @@ jobs:
3131
run: pnpm format:check
3232

3333
- name: Restore cache from S3
34+
if: github.actor != 'dependabot[bot]'
3435
run: |
3536
aws s3 cp s3://${{ secrets.STAGING_AWS_S3_BUCKET }}/cache/${{ github.event.repository.name }}/astro-cache.tar.zst astro-cache.tar.zst || true
3637
tar -xf astro-cache.tar.zst --use-compress-program "zstdmt" || true
@@ -40,4 +41,5 @@ jobs:
4041
AWS_DEFAULT_REGION: ${{ secrets.STAGING_AWS_REGION }}
4142

4243
- name: Build
44+
if: github.actor != 'dependabot[bot]'
4345
run: pnpm build

0 commit comments

Comments
 (0)