mirror of
https://github.com/kamilchodola/wait-for-workflow-action.git
synced 2026-03-11 18:13:50 -05:00
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
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: |
|
|
chmod +x scripts/wait-for-workflow.sh
|
|
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="2"
|
|
export ORG_NAME="kamilchodola"
|
|
export REPO_NAME="wait-for-workflow-action"
|
|
export REF="${{ inputs.ref || github.ref }}"
|
|
./scripts/wait-for-workflow.sh
|