GitHub Action for FtrIO — audit feature toggle state in your .NET codebase, catch MISSING toggles, and verify config before merging.
Part of the FtrIO ecosystem — free, open source feature toggles for .NET.
Scans your .cs files for every [Toggle], [ToggleAsync], and manual toggle call, cross-references them against your appsettings.json, and reports the state of each toggle: ON, OFF, 20%, BLUE, or MISSING.
A MISSING toggle means the key is referenced in code but has no entry in config — this will throw a ToggleDoesNotExistException at runtime. The action fails the build when any MISSING toggles are found, catching config drift before it reaches production.
- uses: FtrOnOff/ftrio-action@v1Scans the current directory, fails if any MISSING toggles are found.
| Input | Default | Description |
|---|---|---|
source |
. |
Directory to scan for .cs files |
config |
(source) | Directory containing appsettings*.json files |
env |
(all) | Target a specific environment overlay (e.g. Staging) |
fail-on-missing |
true |
Fail the build if any MISSING toggles are found |
markdown |
(none) | Path to write a markdown report |
version |
(latest) | Pin a specific version of FtrIO.onetwo |
| Output | Description |
|---|---|
missing-count |
Number of MISSING toggles found |
toggle-count |
Total number of toggles found |
passed |
true if no MISSING toggles found, false otherwise |
steps:
- uses: actions/checkout@v4
- uses: FtrOnOff/ftrio-action@v1- uses: FtrOnOff/ftrio-action@v1
with:
source: ./src
config: ./src/MyApp- uses: FtrOnOff/ftrio-action@v1
with:
source: ./src
env: Staging- uses: FtrOnOff/ftrio-action@v1
with:
source: ./src
fail-on-missing: falseEmits GitHub warning annotations on the PR but does not block the merge. Useful when introducing FtrIO to an existing codebase.
- uses: FtrOnOff/ftrio-action@v1
with:
source: ./src
markdown: toggle-report.mdThe report is automatically uploaded as a build artifact named ftrio-toggle-report.
- uses: FtrOnOff/ftrio-action@v1
id: ftrio
- name: Print summary
run: |
echo "Found ${{ steps.ftrio.outputs.toggle-count }} toggles"
echo "${{ steps.ftrio.outputs.missing-count }} are MISSING"
echo "Passed: ${{ steps.ftrio.outputs.passed }}"- uses: FtrOnOff/ftrio-action@v1
with:
version: '1.1.0'name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: Build
run: dotnet build
- name: Test
run: dotnet test
- name: FtrIO toggle audit
uses: FtrOnOff/ftrio-action@v1
with:
source: ./src
fail-on-missing: true
markdown: toggle-report.mdWhen MISSING toggles are found the action emits inline GitHub annotations:
Warning: FtrIO: UnknownFeature ManualCall MISSING Controllers\HomeController.cs:42
Error: FtrIO found 1 MISSING toggle(s). Add the missing keys to appsettings.json
or remove the [Toggle] attributes.
These appear directly in the PR checks view without needing to open logs.
| Tool | Purpose |
|---|---|
| FtrIO | Core library. [Toggle] attribute woven into IL at compile time. |
| FtrIO.Toaster | Self-hosted Docker UI for managing toggles live. |
| FtrIO.onetwo | CLI audit tool. This action wraps it. |
| export-manifest-action | Export a manifest of required toggle keys for deployment safety checks. |
| release-check-action | Gate deployments on missing toggle config. |
Full docs: ftronoff.github.io/FtrIO