"Updated workflow_run types and formatting in workflow_run_parent.yaml" #3
This file contains hidden or 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 Dispatch Workflow parent | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
trigger-workflow-dispatch-parent: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Token generator | |
uses: githubofkrishnadhas/github-access-using-githubapp@v1 | |
with: | |
github_app_id: ${{ secrets.WDC_APP_ID }} | |
github_app_private_key : ${{ secrets.WDC_PVT_KEY }} | |
github_account_type : organization | |
- name: Trigger another workflow via API | |
env: | |
OWNER_REPO: ${{ github.repository }} | |
WORKFLOW_ID: workflow_dispatch_child.yaml # or the workflow ID if you prefer | |
REF: main # or the branch you want to use | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GH_APP_TOKEN" \ | |
https://api.github.com/repos/${{ env.OWNER_REPO }}/actions/workflows/$WORKFLOW_ID/dispatches \ | |
-d '{"ref":"main","inputs":{"name":"Kunai the Octocat","home":"Tokiyo, Japan"}}' | |
- name: complete | |
run: echo "Hello world" |