aRustyDev / aRustyDev/gh

feat(action): dispatch/trigger - Trigger repository_dispatch events

Open
#39 0 comments 0 reactions 1 assignee Claimed by @aRustyDev View on GitHub
enhancement new-action
Dominant language
Shell
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Parent Epic
Part of #22 (Atomic Release Pipeline Actions)

## Priority
P1 - Core W2/W5 functionality for triggering downstream workflows

## Description

Create a composite action that triggers `repository_dispatch` events to invoke other workflows.

## Inputs

| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `event-type` | Yes | - | Event type to dispatch |
| `client-payload` | No | `{}` | JSON payload to send |
| `repository` | No | `github.repository` | Target repository |
| `token` | No | `github.token` | GitHub token (needs repo scope) |

## Outputs

| Output | Description |
|--------|-------------|
| `dispatched` | "true" if successfully dispatched |

## Usage Example

```yaml
- uses: arustydev/gha/actions/dispatch/trigger@v1
with:
event-type: "chart-pr-created"
client-payload: '{"pr": 123, "artifact": "my-chart"}'
```

## Implementation Notes

- Uses GitHub API `POST /repos/{owner}/{repo}/dispatches`
- Validates JSON payload before sending
- Token must have `repo` scope for cross-repo dispatch

## Source Reference

`gha/.github/workflows/atomic-release-atomize-changes.yml`:
- Trigger validation workflow step (lines 404-418)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.