Skip to content

Trigger test repo workflow #51

Trigger test repo workflow

Trigger test repo workflow #51

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}"