Test WaitForWorkflow #45
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: Test WaitForWorkflow | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'branch' | |
required: false | |
default: '' | |
run_id: | |
description: 'run_id for test' | |
required: false | |
default: '' | |
jobs: | |
test_workflow_dispatch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Trigger another workflow | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: to_be_triggered.yml | |
token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} | |
ref: "${{ inputs.ref || github.ref }}" | |
- name: Wait for the triggered workflow to complete | |
run: | | |
export GITHUB_TOKEN="${{ secrets.REPOSITORY_DISPATCH_TOKEN }}" | |
export WORKFLOW_ID="to_be_triggered.yml" | |
export RUN_ID="${{ inputs.run_id }}" | |
export MAX_WAIT_MINUTES="2" | |
export INTERVAL="5" | |
export TIMEOUT="5" | |
export ORG_NAME="kamilchodola" | |
export REPO_NAME="wait-for-workflow-action" | |
export REF="${{ inputs.ref || github.ref }}" | |
./scripts/wait-for-workflow.sh |