-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: workflow should reference follow-on workflows on triggering branch.
- Loading branch information
1 parent
775a140
commit 14fb7c2
Showing
3 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: 'Trigger Workflow' | ||
description: 'Triggers another GitHub Actions workflow; useful for ensuring the workflow runs based off of the appropriate branch.' | ||
|
||
inputs: | ||
token: | ||
description: 'Personal Access Token (PAT) with permissions to trigger workflows' | ||
required: true | ||
workflowFileName: | ||
description: 'The file name of the workflow to trigger' | ||
required: true | ||
workflowInputs: | ||
description: 'Inputs for the triggered workflow in JSON format' | ||
required: false | ||
default: '{}' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Trigger another workflow | ||
run: | | ||
curl \ | ||
-X POST \ | ||
-H "Authorization: token ${{ inputs.token }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ inputs.workflowFileName }}/dispatches \ | ||
-d '{"ref":"${{ github.ref_name }}", "inputs": ${{ inputs.workflowInputs }}}' | ||
shell: bash |
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
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