This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
Trigger TRES #4
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 TRES | |
on: | |
workflow_dispatch: | |
secrets: | |
E2E_TESTS_PAT: | |
required: true | |
jobs: | |
trigger-job: | |
name: 'Trigger job TRES' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.E2E_TESTS_PAT }} | |
script: | | |
const result = await github.rest.repos.createDispatchEvent({ | |
owner: 'OasisDEX', | |
repo: 'e2e-tests', | |
event_type: 'bcd_release', | |
client_payload: {"version": "v5.3.10"} | |
}) | |
console.log(result); | |
# jobs: | |
# trigger-job: | |
# name: 'Trigger job TRES' | |
# runs-on: ubuntu-latest | |
# env: | |
# E2E_TESTS_PAT: ${{ secrets.E2E_TESTS_PAT }} | |
# steps: | |
# - name: Trigger e2e-tests Workflow | |
# uses: actions/workflow-dispatch@v3 | |
# with: | |
# github-token: ${{ secrets.E2E_TESTS_PAT }} | |
# workflow_id: 'received' # Replace with the ID of Workflow-B | |
# owner: 'OasisDEX' | |
# repository: 'e2e-tests' # Replace with the owner and repository name of Repository-B | |
# - name: Log e2e-tests Workflow URL | |
# run: | | |
# echo "e2e-tests workflow URL: https://github.com/OasisDEX/e2e-tests/actions/runs/${{ steps.trigger-job.outputs.run_id }}" >> $GITHUB_OUTPUT | |
# - name: Log e2e-tests workflow Completion Code | |
# run: | | |
# echo "e2e-test Workflow Completion Code: ${{ steps.trigger-job.outputs.conclusion }}" >> $GITHUB_OUTPUT | |
# - run: echo 'This is the TRIGGER workflow.' | |
# - name: Trigger Workflow in Another 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/OasisDEX/e2e-tests/dispatches \ | |
# -d "{\"event_type\":\"dispatch-event\", \"client_payload\": {\"service\": \"e2e-tests\", \"version\": \"v1.0.1\", \"unit\": false, \"integration\": true}}" |