convictional/trigger-workflow-and-wait

Trigger a workflow in another (or same) repository and wait for the job to finish.

Shell

363

25 commits

updated Jan 5, 2026

See the code

README

Update January 2026: This repository is now archived.

Trigger Workflow and Wait

Github Action for trigger a workflow from another workflow. The action then waits for a response.

When would you use it?

When deploying an app you may need to deploy additional services, this Github Action helps with that.

Arguments

Argument NameRequiredDefaultDescription
ownerTrueN/AThe owner of the repository where the workflow is contained.
repoTrueN/AThe repository where the workflow is contained.
github_tokenTrueN/AThe Github access token with access to the repository. Its recommended you put it under secrets.
workflow_file_nameTrueN/AThe reference point. For example, you could use main.yml.
github_userFalseN/AThe name of the github user whose access token is being used to trigger the workflow.
refFalsemainThe reference of the workflow run. The reference can be a branch, tag, or a commit SHA.
wait_intervalFalse10The number of seconds delay between checking for result of run.
client_payloadFalse{}Payload to pass to the workflow, must be a JSON string
propagate_failureFalsetrueFail current job if downstream job fails.
trigger_workflowFalsetrueTrigger the specified workflow.
wait_workflowFalsetrueWait for workflow to finish.
comment_downstream_urlFalse``A comments API URL to comment the current downstream job URL to. Default: no comment
comment_github_tokenFalse${{github.token}}token used for pull_request comments

Example

Simple

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}

All Options

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
    github_user: github-user
    workflow_file_name: main.yml
    ref: release-branch
    wait_interval: 10
    client_payload: '{}'
    propagate_failure: false
    trigger_workflow: true
    wait_workflow: true

Comment the current running workflow URL for a PR

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
    comment_downstream_url: ${{ github.event.pull_request.comments_url }}

Testing

You can test out the action locally by cloning the repository to your computer. You can run:

INPUT_OWNER="keithconvictional" \
INPUT_REPO="myrepo" \
INPUT_GITHUB_TOKEN="<REDACTED>" \
INPUT_GITHUB_USER="github-user" \
INPUT_WORKFLOW_FILE_NAME="main.yml" \
INPUT_REF="release-branch" \
INPUT_WAIT_INTERVAL=10 \
INPUT_CLIENT_PAYLOAD='{}' \
INPUT_PROPAGATE_FAILURE=false \
INPUT_TRIGGER_WORKFLOW=true \
INPUT_WAIT_WORKFLOW=true \
busybox sh entrypoint.sh

You will have to create a Github Personal access token. You can create a test workflow to be executed. In a repository, add a new main.yml to .github/workflows/. The workflow will be:

name: Main
on:
  workflow_dispatch
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Pause for 25 seconds
        run: |
          sleep 25

You can see the example here. For testing a failure case, just add this line after the sleep:

...
- name: Pause for 25 seconds
  run: |
    sleep 25
    echo "For testing failure"
    exit 1

Potential Issues

Changes

If you do not want the latest build all of the time, please use a versioned copy of the Github Action. You specify the version after the @ sign.

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}

Contributors

neilmayhew

5 commits

duhow

3 commits

convictional/trigger-workflow-and-wait

Trigger a workflow in another (or same) repository and wait for the job to finish.

Shell

363

25 commits

updated Jan 5, 2026

See the code

README

Update January 2026: This repository is now archived.

Trigger Workflow and Wait

Github Action for trigger a workflow from another workflow. The action then waits for a response.

When would you use it?

When deploying an app you may need to deploy additional services, this Github Action helps with that.

Arguments

Argument NameRequiredDefaultDescription
ownerTrueN/AThe owner of the repository where the workflow is contained.
repoTrueN/AThe repository where the workflow is contained.
github_tokenTrueN/AThe Github access token with access to the repository. Its recommended you put it under secrets.
workflow_file_nameTrueN/AThe reference point. For example, you could use main.yml.
github_userFalseN/AThe name of the github user whose access token is being used to trigger the workflow.
refFalsemainThe reference of the workflow run. The reference can be a branch, tag, or a commit SHA.
wait_intervalFalse10The number of seconds delay between checking for result of run.
client_payloadFalse{}Payload to pass to the workflow, must be a JSON string
propagate_failureFalsetrueFail current job if downstream job fails.
trigger_workflowFalsetrueTrigger the specified workflow.
wait_workflowFalsetrueWait for workflow to finish.
comment_downstream_urlFalse``A comments API URL to comment the current downstream job URL to. Default: no comment
comment_github_tokenFalse${{github.token}}token used for pull_request comments

Example

Simple

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}

All Options

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
    github_user: github-user
    workflow_file_name: main.yml
    ref: release-branch
    wait_interval: 10
    client_payload: '{}'
    propagate_failure: false
    trigger_workflow: true
    wait_workflow: true

Comment the current running workflow URL for a PR

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}
    comment_downstream_url: ${{ github.event.pull_request.comments_url }}

Testing

You can test out the action locally by cloning the repository to your computer. You can run:

INPUT_OWNER="keithconvictional" \
INPUT_REPO="myrepo" \
INPUT_GITHUB_TOKEN="<REDACTED>" \
INPUT_GITHUB_USER="github-user" \
INPUT_WORKFLOW_FILE_NAME="main.yml" \
INPUT_REF="release-branch" \
INPUT_WAIT_INTERVAL=10 \
INPUT_CLIENT_PAYLOAD='{}' \
INPUT_PROPAGATE_FAILURE=false \
INPUT_TRIGGER_WORKFLOW=true \
INPUT_WAIT_WORKFLOW=true \
busybox sh entrypoint.sh

You will have to create a Github Personal access token. You can create a test workflow to be executed. In a repository, add a new main.yml to .github/workflows/. The workflow will be:

name: Main
on:
  workflow_dispatch
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Pause for 25 seconds
        run: |
          sleep 25

You can see the example here. For testing a failure case, just add this line after the sleep:

...
- name: Pause for 25 seconds
  run: |
    sleep 25
    echo "For testing failure"
    exit 1

Potential Issues

Changes

If you do not want the latest build all of the time, please use a versioned copy of the Github Action. You specify the version after the @ sign.

- uses: convictional/trigger-workflow-and-wait@v1.6.1
  with:
    owner: keithconvictional
    repo: myrepo
    github_token: ${{ secrets.GITHUB_PERSONAL_ACCESS_TOKEN }}

Contributors

neilmayhew

5 commits

duhow

3 commits

Languages

Shell

97.4%

Dockerfile

2.6%