Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions execute-workflow/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.env
5 changes: 5 additions & 0 deletions execute-workflow/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120
}
30 changes: 30 additions & 0 deletions execute-workflow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Execute Workflow Action

A GitHub Action for triggering workflows via `workflow_dispatch`, waiting for them to complete, and reporting their results.

- Triggers workflows using the `workflow_dispatch` event
- Waits for the workflow run to start (up to 60 seconds)
- Polls the workflow run status until completion
- Outputs the workflow run ID and conclusion
- Fails the action if the triggered workflow doesn't succeed

## Usage

```yaml
- name: Execute workflow
uses: ./execute-workflow
with:
workflow: my-workflow.yaml
inputs: '{ "key": "value" }'
```

## Inputs

- `workflow` (required): Workflow filename relative to `.github/workflows` (e.g., `my-workflow.yaml`)
- `inputs` (optional): Inputs to pass to the workflow as a JSON string
- `token` (optional): GitHub token for authentication (defaults to `${{ github.token }}`)

## Outputs

- `workflowRunId`: The ID of the triggered workflow run
- `conclusion`: The conclusion of the workflow run (`success`, `failure`, `cancelled`, etc.)
18 changes: 18 additions & 0 deletions execute-workflow/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Execute Workflow'
description: 'Execute GitHub Actions workflows and wait for them to complete'

inputs:
workflow:
description: "Workflow filename relative to .github/workflows (e.g., 'my-workflow.yaml')"
required: true
inputs:
description: 'Inputs to pass to the workflow, must be a JSON string'
required: false
token:
description: 'GitHub token for authentication'
required: false
default: ${{ github.token }}

runs:
using: 'node20'
main: 'dist/index.js'
Loading