Forgejo Actions step that opens an issue when a workflow fails on main and closes it when it passes again
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
drorganvidez 32d83c735c
All checks were successful
CI / test (push) Successful in 11s
CI / live (push) Successful in 6s
CI / alert (push) Successful in 4s
Open an issue when a workflow fails on main and close it when it passes
2026-11-18 22:13:19 +01:00
.forgejo/workflows Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
tests Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
.gitignore Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
action.yml Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
alert.py Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
COPYING Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
COPYING.LESSER Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00
README.md Open an issue when a workflow fails on main and close it when it passes 2026-11-18 22:13:19 +01:00

splent_ci_alert

A step for Forgejo Actions (and GitHub Actions) that turns a failed workflow into an issue. A failing run on a watched branch opens an issue, later failing runs comment on it, and the first passing run closes it. Whoever watches the repository gets the notification, by email too when the forge sends mail.

Usage

Add a last job that needs every other job and always runs.

jobs:
  lint:
    ...
  test:
    ...

  alert:
    needs: [lint, test]
    if: always() && github.event_name != 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: https://git.splent.io/splent-io/splent_ci_alert@v1
        with:
          needs: ${{ toJSON(needs) }}

The automatic token is enough. The runner image needs python3.

Inputs

Input Default Meaning
needs The job's needs context as ${{ toJSON(needs) }}
token ${{ github.token }} Token that can read and write issues
branches main Space-separated branches that raise alerts

What counts

Any failed job makes the run failing. A run where every job passed or was skipped is passing. Cancelled runs, pull requests, tags and other branches change nothing.

There is one issue per workflow and branch, found by a hidden marker in its body, so renaming the issue is fine.

License

LGPL-3.0-or-later. See COPYING.LESSER and COPYING.