Trigger test repo workflow #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Trigger test repo workflow' | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
types: [completed] | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_sha }}" | |
cancel-in-progress: true | |
env: | |
TEST_BRANCH: ${{ github.event.workflow_run.head_branch }} | |
TARGET_SHA: ${{ github.event.workflow_run.head_sha }} | |
TEST_ID: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.pull_requests[0].number || github.event.workflow_run.head_sha }} | |
jobs: | |
tests: | |
name: Run functional tests | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger test repository worfklow | |
env: | |
GITHUB_TOKEN: ${{ secrets.FUNCTIONAL_TESTS_TRIGGER }} | |
run: | | |
gh workflow run functional-tests.yml \ | |
--repo yoanm/gha-versioning-test-repo \ | |
--ref "${TEST_BRANCH}" \ | |
-f "sha=${TARGET_SHA}" \ | |
-f "test-id=${TEST_ID}" |