require-forgejo-actions-workflow-dispatch
Require Forgejo Actions workflows to declare a workflow_dispatch trigger.
Targeted pattern scopeâ
This rule scans .forgejo/workflows/*.{yml,yaml} and requires each workflow to include the workflow_dispatch event.
What this rule reportsâ
This rule reports Forgejo workflow files that do not include workflow_dispatch.
Why this rule existsâ
Forgejo Actions supports manual workflow execution via workflow_dispatch. Requiring it keeps maintenance and recovery workflows runnable without forcing commit-based triggers.
â Incorrectâ
name: CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm test
â Correctâ
name: CI
on:
push:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- run: npm test
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.codeberg,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-forgejo-actions-workflow-dispatch": "warn",
},
},
];
When not to use itâ
Disable this rule only if your Forgejo repository intentionally disallows manual workflow execution.
Rule catalog ID: R076