2024-12-19 11:50:59 +00:00
|
|
|
name: integration-pr
|
|
|
|
|
|
|
|
on:
|
2025-01-06 14:30:48 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
# Disable because of https://github.com/databricks/cli/issues/2084.
|
|
|
|
#
|
|
|
|
# pull_request:
|
|
|
|
# types: [opened, synchronize]
|
2024-12-19 11:50:59 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
# Trigger for pull requests.
|
|
|
|
#
|
|
|
|
# This workflow triggers the integration test workflow in a different repository.
|
|
|
|
# It requires secrets from the "test-trigger-is" environment, which are only available to authorized users.
|
|
|
|
trigger:
|
2025-01-06 15:34:42 +00:00
|
|
|
runs-on:
|
|
|
|
group: databricks-deco-testing-runner-group
|
|
|
|
labels: ubuntu-latest-deco
|
|
|
|
|
2024-12-19 11:50:59 +00:00
|
|
|
environment: "test-trigger-is"
|
|
|
|
|
2025-01-03 14:12:55 +00:00
|
|
|
# Only run this job for PRs from branches on the main repository and not from forks.
|
|
|
|
# Workflows triggered by PRs from forks don't have access to the "test-trigger-is" environment.
|
|
|
|
if: "${{ !github.event.pull_request.head.repo.fork }}"
|
2024-12-19 11:50:59 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Generate GitHub App Token
|
|
|
|
id: generate-token
|
|
|
|
uses: actions/create-github-app-token@v1
|
|
|
|
with:
|
|
|
|
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}
|
|
|
|
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
|
|
|
|
owner: ${{ secrets.ORG_NAME }}
|
|
|
|
repositories: ${{secrets.REPO_NAME}}
|
|
|
|
|
|
|
|
- name: Trigger Workflow in Another Repo
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
|
|
|
run: |
|
|
|
|
gh workflow run cli-isolated-pr.yml -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} \
|
|
|
|
--ref main \
|
|
|
|
-f pull_request_number=${{ github.event.pull_request.number }} \
|
|
|
|
-f commit_sha=${{ github.event.pull_request.head.sha }}
|