Skip to content

Sending CI E2E tests result to trigger repository #248

Sending CI E2E tests result to trigger repository

Sending CI E2E tests result to trigger repository #248

name: Sending CI E2E tests result to trigger repository
on:
workflow_run:
workflows: [CI E2E and API tests]
types: [completed]
jobs:
tests-result:
runs-on: ubuntu-latest
steps:
- run: echo 'CI E2E tests result -- ${{ github.event.workflow_run.conclusion }}'
- name: Get trigger repository name
uses: actions/download-artifact@v4
with:
name: trigger_repository_name
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}
- name: Set trigger repository name env variable
run: |
value=`cat trigger_repository.txt`
echo "TRIGGER_REPOSITORY=$value" >> "$GITHUB_ENV"
- name: Triggering E2E tests result workflow in ${{ env.TRIGGER_REPOSITORY }} repository
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.E2E_TESTS_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ env.TRIGGER_REPOSITORY }}/actions/workflows/e2e-tests-result.yaml/dispatches \
-d "{\"ref\":\"dev\", \"inputs\":{\"tests_run_id\":\"${{ github.event.workflow_run.id }}\", \"tests_result\":\"${{ github.event.workflow_run.conclusion }}\"}}"