Skip to content

Commit fd337f0

Browse files
committed
Skip integration trigger for dependabot PRs
Dependabot does not have access to the "test-trigger-is" environment secrets, causing the integration-trigger job to fail. Skip this job for dependabot and add a new job that marks the required "Integration Tests" check as passed using the built-in GITHUB_TOKEN. Co-authored-by: Isaac
1 parent db8ad02 commit fd337f0

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

.github/workflows/push.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,14 @@ jobs:
362362
fi
363363
364364
# Trigger integration tests in a separate repository.
365-
# Requires secrets from "test-trigger-is" environment (not available for fork PRs).
365+
# Requires secrets from "test-trigger-is" environment (not available for fork PRs or dependabot).
366366
# Auto-approves for merge groups to avoid running twice and queue timeouts.
367367
integration-trigger:
368368
needs:
369369
- testmask
370370

371371
if: >-
372-
(github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) ||
372+
(github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.pull_request.user.login != 'dependabot[bot]') ||
373373
(github.event_name == 'merge_group') ||
374374
(github.event_name == 'push')
375375
@@ -468,3 +468,37 @@ jobs:
468468
gh workflow run cli-isolated-nightly.yml -R ${{ secrets.ORG_NAME }}/${{ secrets.REPO_NAME }} \
469469
--ref main \
470470
-f commit_sha=${{ github.event.after }}
471+
472+
# Skip integration tests for dependabot PRs.
473+
# Dependabot has no access to the "test-trigger-is" environment secrets,
474+
# so we use the built-in GITHUB_TOKEN (with checks:write) to mark the
475+
# required "Integration Tests" check as passed.
476+
integration-trigger-dependabot:
477+
if: >-
478+
github.event_name == 'pull_request' &&
479+
github.event.pull_request.user.login == 'dependabot[bot]'
480+
481+
runs-on:
482+
group: databricks-deco-testing-runner-group
483+
labels: ubuntu-latest-deco
484+
485+
permissions:
486+
checks: write
487+
488+
steps:
489+
- name: Skip integration tests
490+
uses: actions/github-script@v8
491+
with:
492+
script: |
493+
await github.rest.checks.create({
494+
owner: context.repo.owner,
495+
repo: context.repo.repo,
496+
name: 'Integration Tests',
497+
head_sha: '${{ github.event.pull_request.head.sha }}',
498+
status: 'completed',
499+
conclusion: 'success',
500+
output: {
501+
title: 'Integration Tests',
502+
summary: '⏭️ Skipped (dependabot PR)'
503+
}
504+
});

0 commit comments

Comments
 (0)