"Deleted 5 GitHub workflow files and updated README.md" DEVOPS-256 #1
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 a workflow using workflow_run | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
trigger-workflow-run: | |
runs-on: ubuntu-latest | |
# this child workflow will only run if parent workflow execution is success | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
# This is an optional step | |
- uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ secrets.WDC_APP_ID }} | |
private-key: ${{ secrets.WDC_PVT_KEY }} | |
- name: Print triggering workflow and build number | |
run: | | |
echo "Triggered by workflow: ${{ github.event.workflow_run.name }}" | |
echo "Build number: ${{ github.event.workflow_run.run_number }}" | |
echo "Run ID: ${{ github.event.workflow_run.id }}" | |
- name: echo stmnts | |
run: echo "i am a cat" | |
- name: println | |
run: echo "testing out workflow run on main branch to trigger worklfow named Build" | |
- name: complete | |
run: echo "Hello world" |