No description
  • TypeScript 97.8%
  • JavaScript 2.2%
Find a file
Thibaut Cholley 431579a53f
All checks were successful
Check dist/ / Check committed dist/ is up to date (push) Successful in 14s
Self-test / Test failing dispatch (must fail) (push) Has been skipped
Self-test / Test successful dispatch (push) Successful in 33s
feat: rewrite as Node.js action
Replaces the previous bash composite action with a TypeScript-based
Node.js action bundled with @vercel/ncc. This removes the dependency
on jq and curl on the runner side, matching the convention of official
GitHub Actions like actions/checkout.

Features:
- Uses return_run_info: true to capture the triggered run id immediately
- Polls until the run completes with configurable timeout/interval
- Configurable list of conclusions that fail the action
- Unit tests with Jest for dispatcher and waiter modules
- check-dist workflow ensures committed bundle stays in sync with sources
- Self-test workflow validates the full flow end-to-end
2026-05-15 12:44:59 +02:00
.forgejo/workflows feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
__tests__ feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
dist feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
src feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
.eslintignore feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
.eslintrc.json feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
.gitattributes feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
.gitignore feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
.prettierignore feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
.prettierrc.json feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
action.yml feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
jest.config.js feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
LICENSE feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
package-lock.json feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
package.json feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
README.md feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00
tsconfig.json feat: rewrite as Node.js action 2026-05-15 12:44:59 +02:00

actions-dispatch-and-wait

Forgejo action to trigger a workflow_dispatch event on another repository and wait for its completion. Written in TypeScript, distributed as a Node.js action — no jq, curl, or shell dependencies required on the runner.

Requirements

  • Forgejo instance with return_run_info support on the dispatch endpoint (Forgejo PR #7193, available in Forgejo 10+)
  • A Forgejo token with write:repository scope on the target repository

Usage

- name: Trigger downstream workflow
  uses: forge.app-cp.fr/Elsie/actions-dispatch-and-wait@v1
  with:
    repository: Elsie/infra-copilote-api
    workflow-file: ci.yml
    ref: review
    token: ${{ secrets.DOWNSTREAM_FORGEJO_TOKEN }}
    inputs-json: |
      {
        "action": "apply",
        "unresolved_review_id": "${{ github.head_ref }}"
      }

Inputs

Name Required Default Description
server-url no https://forge.app-cp.fr Forgejo instance URL
repository yes Target repo (owner/name)
workflow-file yes Workflow filename (e.g. ci.yml)
ref no main Branch/tag to run the workflow on
inputs-json no {} JSON string of inputs to pass
token yes Forgejo token with write:repository
timeout-seconds no 1800 Max wait time in seconds
poll-interval no 15 Polling interval in seconds
fail-on-conclusion no failure,cancelled,timed_out,action_required Comma-separated conclusions that fail the action

Outputs

Name Description
run-id Numeric ID of the triggered run
run-number Human-friendly run number
run-url Web URL pointing to the triggered run
conclusion Final conclusion (success, failure, cancelled, …)

Development

# Install dependencies
npm install

# Run the test suite
npm test

# Lint and format
npm run lint
npm run format

# Build the bundle (must be committed)
npm run build

# Run everything before pushing
npm run all

The dist/ directory must be committed — Forgejo runners execute it directly without running npm install. The check-dist.yml workflow ensures the committed bundle is always in sync with the sources.

License

See LICENSE. Internal Elsie use only.