- Shell 83.6%
- Python 16.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Closes #3 Monitoring plan, phase 5 rollout, same as the pilots argus/backend#45 and argus/frontend#35. ## Changes (`.forgejo/workflows/ci.yml`) - No collect step: composite actions have no build artifact or dependencies, the report carries the version and the release page. Numbered releases only (no devel draft here). - The publish-release call (numbered release) gets `ARGUS_UPLOAD_TOKEN: ${{ secrets.ARGUS_UPLOAD_TOKEN }}`. A failed upload only warns, the release itself is unaffected. Needs the repository secret `ARGUS_UPLOAD_TOKEN` (project upload token) before the next release; without it publish-release just skips the report. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014BSmBtGWeFBD9z4mYm9SjA Reviewed-on: #4 |
||
| .forgejo/workflows | ||
| dispatch-and-wait | ||
| report-status | ||
| tests | ||
| lib.sh | ||
| LICENSE | ||
| README.md | ||
| renovate.json | ||
guardians_of_the_galaxy/actions
Shared Forgejo Actions composite actions for the ecosystem.
dispatch-and-wait
Dispatches a workflow_dispatch in another repo and blocks until it
reports back — via a commit status on the caller's own commit, not
by scanning the target repo's job list for "the one we just started".
That search is what this replaces: Forgejo's dispatch API doesn't hand
back the run it just created (same limitation as GitHub's), so finding
it again meant guessing "the newest job named X, dispatched after
timestamp Y" — racy, and wrong if the target runner is busy (a real
run took over 2 minutes just to get a task record). A commit status
has no such ambiguity: it's keyed by repo+sha+context, and this action
owns that key from the moment it posts the initial pending state.
- name: Trigger Filao/e2e and wait for it to finish
uses: https://git.stationmyr.net/guardians_of_the_galaxy/actions/dispatch-and-wait@v1
with:
token: ${{ secrets.PACKAGES_TOKEN }}
target-repo: Filao/e2e
target-ref: master
target-inputs: '{"backend_ref": "${{ github.sha }}"}'
status-context: filao-e2e
The target workflow must declare three extra workflow_dispatch
inputs (status_repo, status_sha, status_context) — this action
merges them into whatever target-inputs you pass — and report back
using report-status (below) once it's done, if: always()-style
(two steps, if: success() / if: failure()).
report-status
The callee's half of the contract above. Call it from the dispatched
workflow, using the status_repo/status_sha/status_context inputs
the dispatcher added:
on:
workflow_dispatch:
inputs:
backend_ref: {required: false, default: '', type: string}
status_repo: {required: false, default: '', type: string}
status_sha: {required: false, default: '', type: string}
status_context: {required: false, default: '', type: string}
jobs:
e2e:
steps:
- run: ./run-the-actual-tests.sh
- name: Report success
if: success() && inputs.status_repo != ''
uses: https://git.stationmyr.net/guardians_of_the_galaxy/actions/report-status@v1
with:
token: ${{ secrets.PACKAGES_TOKEN }}
repo: ${{ inputs.status_repo }}
sha: ${{ inputs.status_sha }}
context: ${{ inputs.status_context }}
state: success
- name: Report failure
if: failure() && inputs.status_repo != ''
uses: https://git.stationmyr.net/guardians_of_the_galaxy/actions/report-status@v1
with:
token: ${{ secrets.PACKAGES_TOKEN }}
repo: ${{ inputs.status_repo }}
sha: ${{ inputs.status_sha }}
context: ${{ inputs.status_context }}
state: failure
The inputs.status_repo != '' guard keeps the workflow usable on its
own (plain push/pull_request runs, where those inputs are empty)
without failing on a missing repo/sha.
The token needs write:repository access to both repos — secrets. PACKAGES_TOKEN already has it for every repo sharing an org, which is
the only case this has been used for so far.
Testing
sh tests/run.sh # needs python3, curl, jq -- spins up a fake Forgejo API
Releasing
Manual workflow_dispatch with a version (X.Y.Z) tags vX.Y.Z,
creates its release, and moves the floating vX major tag callers
pin against — see .forgejo/workflows/ci.yml, same mechanism as
argus/upload-action.