# Adopt it in an existing repository (https://ciatlas.github.io/flowpact/docs/adopting) A first run on a repository that has grown for years can list dozens of findings. Most are real: values that arrive empty, secrets that never reach the workflow that reads them. This is one order that works: see how many there are, fix the errors, accept the rest with a reason and a date, and keep new ones out with CI. ### See how many there are [#see-how-many-there-are] ```sh npx flowpact lint --hide-info ``` The summary at the end counts the findings per severity and lists the most frequent codes. To count them per rule: ```sh npx flowpact lint --format json | jq -r '.findings[].code' | sort | uniq -c | sort -rn ``` ### Fix the errors first [#fix-the-errors-first] Errors are what breaks or silently skips work: a matrix leg that gets an empty value, a required input or secret a caller does not pass, a secret read without being declared, a call GitHub rejects. Warnings are what may, or what is left over: an optional input without a default that decides an `if:`, an input or output nothing reads. Take one rule at a time: ```sh npx flowpact lint --only FP401 # one rule npx flowpact explain FP401 # why it matters, how to fix it, an example ``` Each [rule's page](https://ciatlas.github.io/flowpact/docs/rules) has the same. ### Accept what can wait, with a reason and a date [#accept-what-can-wait-with-a-reason-and-a-date] A finding you cannot fix now goes into the [config](https://ciatlas.github.io/flowpact/docs/configuration#overrides) as an override: the rule, what it is about, why it is acceptable, and until when. ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP105 target: .github/workflows/deploy.yml#inputs.region reason: Every caller passes region; the default is added in the next deploy rework. expires: 2026-12-31 owner: '@platform-team' ``` `target` is the finding's symbol, and `file` matches every finding in a file or under a path. To list the symbols: ```sh npx flowpact lint --format json | jq -r '.findings[] | "\(.code) \(.symbol // .loc.file)"' ``` Accepted findings move to a list of their own, with their reasons. When the date passes, the finding comes back with [`FP901`](https://ciatlas.github.io/flowpact/docs/rules/fp901); an override that no longer matches anything is [`FP902`](https://ciatlas.github.io/flowpact/docs/rules/fp902), and one that expires within two weeks [`FP903`](https://ciatlas.github.io/flowpact/docs/rules/fp903). ### Change a rule that does not fit [#change-a-rule-that-does-not-fit] When a whole rule does not fit how your repository works, change its severity rather than accepting each finding: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP105: info # listed, never fails a run needs-without-data: warning # an opt-in rule, named instead of numbered ``` Each rule can be `error`, `warning`, `info` or `off`, by code or name ([Configuration](https://ciatlas.github.io/flowpact/docs/configuration)). ### Keep new findings out [#keep-new-findings-out] Run it on every pull request. With the [GitHub Action](https://ciatlas.github.io/flowpact/docs/action), findings become annotations on the lines a pull request changes, and the step fails on errors (`fail-on: warning` also fails on warnings, `never` on nothing): ```yaml title=".github/workflows/flowpact.yml" name: flowpact on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA - uses: ciatlas/flowpact@v0.29 # pin to a commit SHA ``` Make the job a required status check once the errors are gone. See [Run on pull requests](https://ciatlas.github.io/flowpact/docs/ci). ### Check the calls into other repositories [#check-the-calls-into-other-repositories] When your workflows call workflows or actions in other repositories, record their interfaces and commit the lockfile, so those calls are checked too: ```sh npx flowpact remotes update ``` Then run `flowpact remotes update --dry-run --fail-on breaks` on a schedule, to hear when a moved tag breaks one of your calls ([A scheduled drift check](https://ciatlas.github.io/flowpact/docs/remote-interfaces#a-scheduled-drift-check)). If other repositories call your workflows or actions, [contracts](https://ciatlas.github.io/flowpact/docs/contracts) and [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) come next: they keep a change that breaks those callers out of a patch release. # Changelog (https://ciatlas.github.io/flowpact/docs/changelog) All notable changes to flowpact (called wfc before 0.2.0) are documented here. The project uses [Semantic Versioning](https://semver.org/). Rule codes (`FPnnn`) are stable: a code never changes meaning, and removed codes are not reused. They were renamed once, from `WFCnnn` to `FPnnn` with the same numbers, in 0.2.0. ## [0.29.2](https://github.com/ciatlas/flowpact/compare/v0.29.1...v0.29.2) (2026-11-13) [#0292-2026-11-13] ### Bug Fixes [#bug-fixes] * **language-server:** find a cached remote source on any host the cache keeps it ([#278](https://github.com/ciatlas/flowpact/issues/278)) ([f119215](https://github.com/ciatlas/flowpact/commit/f119215341eea7e0b5756f8e5b19436de1678510)) ## [0.29.1](https://github.com/ciatlas/flowpact/compare/v0.29.0...v0.29.1) (2026-11-02) [#0291-2026-11-02] ### Bug Fixes [#bug-fixes-1] * **cli:** keep remote sources in core's directory cache, under a host directory; run `flowpact remotes download` once to fill it again ([#273](https://github.com/ciatlas/flowpact/issues/273)) ([4e3ae8f](https://github.com/ciatlas/flowpact/commit/4e3ae8f96f3c4a723fa655b3f7210d495528536e)) * **deps:** update dependency vscode-languageserver-textdocument to v1.0.16 ([#270](https://github.com/ciatlas/flowpact/issues/270)) ([eeacf58](https://github.com/ciatlas/flowpact/commit/eeacf58ce3d34b4be3d5967f1220e2550b6b07bf)) * **deps:** update dependency zod to v4.6.7 ([#271](https://github.com/ciatlas/flowpact/issues/271)) ([e02b69f](https://github.com/ciatlas/flowpact/commit/e02b69f2220461953fdbbc3e8ced5e951750e017)) ## [0.29.0](https://github.com/ciatlas/flowpact/compare/v0.28.0...v0.29.0) (2026-10-29) [#0290-2026-10-29] ### Features [#features] * **language-server:** hover tells whether an expression is a condition or a value, what it yields, and when a step output may be empty ([#260](https://github.com/ciatlas/flowpact/issues/260)) ([765d5f2](https://github.com/ciatlas/flowpact/commit/765d5f2e0f47f9805504664d2bf6fa50c3f60186)) * **rules:** FP105 and FP107 treat default: '' as no default, since GitHub passes '' for an omitted input anyway ([#254](https://github.com/ciatlas/flowpact/issues/254)) ([751b83f](https://github.com/ciatlas/flowpact/commit/751b83f38758c20f8ec762cb598e50c2638115aa)) * **rules:** FP506 reports a value that is read as a boolean but can be another string ([#259](https://github.com/ciatlas/flowpact/issues/259)) ([765d5f2](https://github.com/ciatlas/flowpact/commit/765d5f2e0f47f9805504664d2bf6fa50c3f60186)) * **rules:** FP507 reports a redundant != '' or == '' in a condition, with a fix that removes it ([#256](https://github.com/ciatlas/flowpact/issues/256)) ([adda22c](https://github.com/ciatlas/flowpact/commit/adda22c315d0d26a17507f4c90c1ada8ec837ed7)) * **rules:** FP614 reports an actions.lock flowpact cannot read, instead of checking remote references at their ref without saying so ([#258](https://github.com/ciatlas/flowpact/issues/258)) ([765d5f2](https://github.com/ciatlas/flowpact/commit/765d5f2e0f47f9805504664d2bf6fa50c3f60186)) ### Bug Fixes [#bug-fixes-2] * **lint:** actions.lock pins actions only, not reusable workflow calls, and its v0.0.1 keys are read ([#257](https://github.com/ciatlas/flowpact/issues/257)) ([adda22c](https://github.com/ciatlas/flowpact/commit/adda22c315d0d26a17507f4c90c1ada8ec837ed7)) * **rules:** FP105 leaves out skips the workflow expects and conditions an omitted input cannot turn false ([#253](https://github.com/ciatlas/flowpact/issues/253)) ([6215b59](https://github.com/ciatlas/flowpact/commit/6215b59ed2d34e866df58620874228cf17570539)) * **rules:** FP505 accepts case() in a job's if: without ${{ }} ([#255](https://github.com/ciatlas/flowpact/issues/255)) ([751b83f](https://github.com/ciatlas/flowpact/commit/751b83f38758c20f8ec762cb598e50c2638115aa)) ## [0.28.0](https://github.com/ciatlas/flowpact/compare/v0.27.0...v0.28.0) (2026-10-20) [#0280-2026-10-20] ### Features [#features-1] * **cli:** name the GitHub API and token before fetching, show progress, and say what to check on failure ([#245](https://github.com/ciatlas/flowpact/issues/245)) ([b4f591f](https://github.com/ciatlas/flowpact/commit/b4f591fd0a722d00d31357c1e99d74b6ab2e14f2)) ### Bug Fixes [#bug-fixes-3] * **lint:** fail fast once the GitHub API host cannot be reached, instead of waiting for each reference ([#245](https://github.com/ciatlas/flowpact/issues/245)) ([b4f591f](https://github.com/ciatlas/flowpact/commit/b4f591fd0a722d00d31357c1e99d74b6ab2e14f2)) ## [0.27.0](https://github.com/ciatlas/flowpact/compare/v0.26.0...v0.27.0) (2026-10-20) [#0270-2026-10-20] ### Features [#features-2] * **api:** token for fetchRemotes, and version changes graded by lint and check ([#242](https://github.com/ciatlas/flowpact/issues/242)) ([04dbdfe](https://github.com/ciatlas/flowpact/commit/04dbdfee479124e7161811795ad0e5d2f8bf7cdd)) * **cli:** grade version changes with --fetch-remotes ([#243](https://github.com/ciatlas/flowpact/issues/243)) ([36fa03f](https://github.com/ciatlas/flowpact/commit/36fa03f0b3dc6b4fac997f7d4e0e96ae5cdd24da)) ### Bug Fixes [#bug-fixes-4] * **lint:** impact mode's own rules take their severities and overrides from the baseline ([#239](https://github.com/ciatlas/flowpact/issues/239)) ([0fbd259](https://github.com/ciatlas/flowpact/commit/0fbd25932bf545f2dc26e6dda3e70e88792b37bd)) * **lint:** quick fixes and completion write only names that need no quoting ([#240](https://github.com/ciatlas/flowpact/issues/240)) ([3d54ae8](https://github.com/ciatlas/flowpact/commit/3d54ae866b7e54bf10a9469de61314840b0e9260)) ## [0.26.0](https://github.com/ciatlas/flowpact/compare/v0.25.1...v0.26.0) (2026-10-20) [#0260-2026-10-20] ### Features [#features-3] * **rules:** FP613 checks remote reusable workflows against the lockfile ([#237](https://github.com/ciatlas/flowpact/issues/237)) ([78bd743](https://github.com/ciatlas/flowpact/commit/78bd7434a014c1e8bfd2bf3a1bf4bd3204857d04)) * **rules:** FP613 reports a called job that requests permissions the call does not grant ([#235](https://github.com/ciatlas/flowpact/issues/235)) ([554b53e](https://github.com/ciatlas/flowpact/commit/554b53ea1e4711242a2c279bfc4ebdeb471ca997)) ### Bug Fixes [#bug-fixes-5] * **lint:** impact mode grades a calling job's permissions as GitHub checks them ([#238](https://github.com/ciatlas/flowpact/issues/238)) ([4671b5f](https://github.com/ciatlas/flowpact/commit/4671b5f52ae0bf4c350fd59a4c3aab82366a1009)) ## [0.25.1](https://github.com/ciatlas/flowpact/compare/v0.25.0...v0.25.1) (2026-10-19) [#0251-2026-10-19] ### Bug Fixes [#bug-fixes-6] * **rules:** FP107 says the input is empty when the optional one is omitted ([#233](https://github.com/ciatlas/flowpact/issues/233)) ([6d2773d](https://github.com/ciatlas/flowpact/commit/6d2773d6649cf91eab87472953ccacb9eafeef1f)) ## [0.25.0](https://github.com/ciatlas/flowpact/compare/v0.24.0...v0.25.0) (2026-10-19) [#0250-2026-10-19] ### Features [#features-4] * **lint:** accept a finding on its line with a # flowpact: ignore comment ([#230](https://github.com/ciatlas/flowpact/issues/230)) ([83914e3](https://github.com/ciatlas/flowpact/commit/83914e32a6e5c28b22fb93f1e45b5340b1a5d263)) ## [0.24.0](https://github.com/ciatlas/flowpact/compare/v0.23.0...v0.24.0) (2026-10-17) [#0240-2026-10-17] ### Features [#features-5] * **language-server:** complete the inputs and secrets a call does not pass yet ([#220](https://github.com/ciatlas/flowpact/issues/220)) ([a9dd8f1](https://github.com/ciatlas/flowpact/commit/a9dd8f12dc83b034dfc34aad6b44ff8a2ee534f7)) * **language-server:** navigate to a step's own env and to steps from their outcome ([#222](https://github.com/ciatlas/flowpact/issues/222)) ([d643603](https://github.com/ciatlas/flowpact/commit/d6436032ebb34c4593c40103ead53612b169754a)) ## [0.23.0](https://github.com/ciatlas/flowpact/compare/v0.22.0...v0.23.0) (2026-10-16) [#0230-2026-10-16] ### Features [#features-6] * **language-server:** rename inputs, secrets and outputs across the repository ([#213](https://github.com/ciatlas/flowpact/issues/213)) ([6d6a9fa](https://github.com/ciatlas/flowpact/commit/6d6a9fa02421baf50833b7155c15231328390854)) ## [0.22.0](https://github.com/ciatlas/flowpact/compare/v0.21.1...v0.22.0) (2026-10-16) [#0220-2026-10-16] ### Features [#features-7] * **language-server:** hover and go to definition in contract files ([#211](https://github.com/ciatlas/flowpact/issues/211)) ([26b6177](https://github.com/ciatlas/flowpact/commit/26b6177cf6ff278ced3a4a4741b0a60ee28aed0c)) * **language-server:** quick fixes, and accepting a finding with an override ([#207](https://github.com/ciatlas/flowpact/issues/207)) ([951c9f3](https://github.com/ciatlas/flowpact/commit/951c9f3f8b6a1c4feb00946cb8a79478853e9d64)) * **language-server:** regenerate the contracts from a contract finding ([#209](https://github.com/ciatlas/flowpact/issues/209)) ([ac8f4f3](https://github.com/ciatlas/flowpact/commit/ac8f4f33ad8e8bfd80cfd20e807de0b59ef5e9f4)) * **lint:** findings suggest the fix when it is certain, starting with renames ([#205](https://github.com/ciatlas/flowpact/issues/205)) ([72005cb](https://github.com/ciatlas/flowpact/commit/72005cbe0e4e89a9d930bb0b989ef337c0fc275e)) * **lint:** suggest adding a missing input, secret or matrix key, and removing an unused input ([#206](https://github.com/ciatlas/flowpact/issues/206)) ([72005cb](https://github.com/ciatlas/flowpact/commit/72005cbe0e4e89a9d930bb0b989ef337c0fc275e)) ### Bug Fixes [#bug-fixes-7] * **language-server:** analyze a repository with no .github folder, such as an action's ([#210](https://github.com/ciatlas/flowpact/issues/210)) ([db60409](https://github.com/ciatlas/flowpact/commit/db60409a6a48ff63eb0f3c3844f334ea86f50aa1)) ## [0.21.1](https://github.com/ciatlas/flowpact/compare/v0.21.0...v0.21.1) (2026-10-15) [#0211-2026-10-15] ### Bug Fixes [#bug-fixes-8] * **lint:** a removed action input warns the steps that pass it, it does not fail them ([#200](https://github.com/ciatlas/flowpact/issues/200)) ([97d6f1a](https://github.com/ciatlas/flowpact/commit/97d6f1a76d400a881c2e64bd65b9443774efbdbe)) * **lint:** retry GitHub API requests that fail in a way that passes ([#192](https://github.com/ciatlas/flowpact/issues/192)) ([84e488e](https://github.com/ciatlas/flowpact/commit/84e488e0633e03be4686187a028da79d170c0341)) ## [0.21.0](https://github.com/ciatlas/flowpact/compare/v0.20.0...v0.21.0) (2026-10-15) [#0210-2026-10-15] ### Features [#features-8] * **action:** grade the remote references a pull request moves to another version ([#183](https://github.com/ciatlas/flowpact/issues/183)) ([0dc8ab5](https://github.com/ciatlas/flowpact/commit/0dc8ab5fe5105f9d2ed4f48fdbf58dec244fe55e)) * **cli:** remotes download, and a per-user cache of the remote sources for the editor ([#171](https://github.com/ciatlas/flowpact/issues/171)) ([faaf945](https://github.com/ciatlas/flowpact/commit/faaf94517ff2be2f426b7a6c4182db91657c674d)) * **cli:** remotes update says what each changed entry does to your calls ([#182](https://github.com/ciatlas/flowpact/issues/182)) ([82b1981](https://github.com/ciatlas/flowpact/commit/82b19813da0b41eeb3fb17cb61b911df563242e9)) * **cli:** remotesUpdate, remotesDownload and remotesClean in the API ([#173](https://github.com/ciatlas/flowpact/issues/173)) ([5b5943b](https://github.com/ciatlas/flowpact/commit/5b5943bfe52a55c573169c84a216c6825d5a7ac8)) * **language-server:** describe remote calls and their keys from the remotes lockfile ([#169](https://github.com/ciatlas/flowpact/issues/169)) ([93fd11a](https://github.com/ciatlas/flowpact/commit/93fd11a44f80f4656605c7722e5dba81701d3115)) * **language-server:** go to the cached sources of remote workflows and actions ([#172](https://github.com/ciatlas/flowpact/issues/172)) ([86dd462](https://github.com/ciatlas/flowpact/commit/86dd462d9c414d630af96ce03d6a5bc49fd3d9ad)) * **lint:** check remote references at the commits GitHub's actions.lock pins ([#184](https://github.com/ciatlas/flowpact/issues/184)) ([aa677dc](https://github.com/ciatlas/flowpact/commit/aa677dc71e10aa0be8cecf99fd0a7a9703a88951)) * **lint:** FP205 for remote reusable workflows, from the secrets the lockfile records they read without declaring ([#168](https://github.com/ciatlas/flowpact/issues/168)) ([b030b55](https://github.com/ciatlas/flowpact/commit/b030b55f9b9fab70a2b41c9588bcf03579d4a0b1)) * **lint:** grade a remote version change against the repository's calls ([#181](https://github.com/ciatlas/flowpact/issues/181)) ([1c5244c](https://github.com/ciatlas/flowpact/commit/1c5244c2b3457bb241b2e1fab6336aa93855cfc1)) ### Bug Fixes [#bug-fixes-9] * **lint:** for a remote call, suggest removing what the callee does not declare ([#187](https://github.com/ciatlas/flowpact/issues/187)) ([653d929](https://github.com/ciatlas/flowpact/commit/653d929886b0042aafcdc25e67d06dbcab128741)) * **rules:** FP612 reports, and the checks skip, a lockfile entry with another commit than its reference pins ([#174](https://github.com/ciatlas/flowpact/issues/174)) ([703030d](https://github.com/ciatlas/flowpact/commit/703030ded3707170e97c7ada4785ff5f1e4a2c63)) ## [0.20.0](https://github.com/ciatlas/flowpact/compare/v0.19.1...v0.20.0) (2026-10-14) [#0200-2026-10-14] ### Features [#features-9] * **cli:** look on github.com for what GitHub Enterprise Server lacks, as GitHub Connect does ([#167](https://github.com/ciatlas/flowpact/issues/167)) ([a36a5ba](https://github.com/ciatlas/flowpact/commit/a36a5bac2dde21cdc4cafe3c1e43c5658d6189dd)) * **cli:** remotes update takes paths, shows progress and the token, and says why a fetch failed ([#165](https://github.com/ciatlas/flowpact/issues/165)) ([975d647](https://github.com/ciatlas/flowpact/commit/975d647856f02600226efb97d92cf8976cc0549b)) ## [0.19.1](https://github.com/ciatlas/flowpact/compare/v0.19.0...v0.19.1) (2026-10-14) [#0191-2026-10-14] ### Bug Fixes [#bug-fixes-10] * **lint:** fixes from smoke-testing 0.19.0 on real repositories ([#163](https://github.com/ciatlas/flowpact/issues/163)) ([68d789a](https://github.com/ciatlas/flowpact/commit/68d789a551bcbd8211ce072126ac34dd8a9cf45f)) ## [0.19.0](https://github.com/ciatlas/flowpact/compare/v0.18.0...v0.19.0) (2026-10-14) [#0190-2026-10-14] ### Features [#features-10] * **action:** fetch the remote interfaces a lockfile lacks in CI, report an outdated lockfile, and document Renovate and Dependabot ([#161](https://github.com/ciatlas/flowpact/issues/161)) ([694955a](https://github.com/ciatlas/flowpact/commit/694955a72f6e793c046f018b89cef158f93ba273)) * **cli:** flowpact remotes update fetches the remote interfaces lockfile ([#160](https://github.com/ciatlas/flowpact/issues/160)) ([d1b8ab9](https://github.com/ciatlas/flowpact/commit/d1b8ab9026f37b3b80723a358e13a292ae929e3a)) * **impact:** grade a job that gains, changes or loses its environment ([#155](https://github.com/ciatlas/flowpact/issues/155)) ([a02ad35](https://github.com/ciatlas/flowpact/commit/a02ad35aee38c53c5dbe0ae4c2eb4cbba5d0a6dd)) * **impact:** grade a job that needs runners callers may not have ([#154](https://github.com/ciatlas/flowpact/issues/154)) ([4d27fd2](https://github.com/ciatlas/flowpact/commit/4d27fd2b43f6e6782137c288c0325066224655eb)) * **impact:** grade an artifact a published unit no longer uploads ([#156](https://github.com/ciatlas/flowpact/issues/156)) ([72146e0](https://github.com/ciatlas/flowpact/commit/72146e05c20351b03870b8d6eb8acc6ee7f7f6a5)) * **impact:** grade an output that is now set only when an if: holds ([#153](https://github.com/ciatlas/flowpact/issues/153)) ([5a34a90](https://github.com/ciatlas/flowpact/commit/5a34a90c338cd9ca406c69967f66e70c67884ef4)) * **impact:** grade changed jobs or steps of a published unit as a patch ([#157](https://github.com/ciatlas/flowpact/issues/157)) ([ef22a21](https://github.com/ciatlas/flowpact/commit/ef22a219d5af186c64ec1e587b73cf5940304750)) * **lint:** check inputs passed to remote workflows and actions against a lockfile of their interfaces ([#158](https://github.com/ciatlas/flowpact/issues/158)) ([debbe85](https://github.com/ciatlas/flowpact/commit/debbe85f08d4afc36c94c784464556f94a690551)) * **lint:** check secrets passed to, and outputs read from, remote workflows and actions ([#159](https://github.com/ciatlas/flowpact/issues/159)) ([53e2ca4](https://github.com/ciatlas/flowpact/commit/53e2ca4056516c214a8291ff01f7294ac9174f8b)) ### Bug Fixes [#bug-fixes-11] * **deps:** update dependency zod to v4.6.6 ([#149](https://github.com/ciatlas/flowpact/issues/149)) ([7b11e6e](https://github.com/ciatlas/flowpact/commit/7b11e6e9719e5bf0e54a90f0a8e1745cac955877)) ## [0.18.0](https://github.com/ciatlas/flowpact/compare/v0.17.1...v0.18.0) (2026-10-14) [#0180-2026-10-14] ### Features [#features-11] * **contracts:** write new contracts as .contract.yaml and read .contract.yml too ([#147](https://github.com/ciatlas/flowpact/issues/147)) ([c034092](https://github.com/ciatlas/flowpact/commit/c0340920eb47e1537712761d659f3d1abce9656b)) ## [0.17.1](https://github.com/ciatlas/flowpact/compare/v0.17.0...v0.17.1) (2026-10-14) [#0171-2026-10-14] ### Bug Fixes [#bug-fixes-12] * **impact:** keep the links inside the repository on a base config path that enters it through a link outside it ([#144](https://github.com/ciatlas/flowpact/issues/144)) ([4c1ba54](https://github.com/ciatlas/flowpact/commit/4c1ba54db9e23a06040368a2d098f8e3079dd92f)) ## [0.17.0](https://github.com/ciatlas/flowpact/compare/v0.16.0...v0.17.0) (2026-10-14) [#0170-2026-10-14] ### Features [#features-12] * **trace:** follow a whole secrets read to every secret a workflow holds, and name the workflow of a secret no file declares, with core 2.0.0; see https://ciatlas.github.io/flowpact/docs/upgrading ([#141](https://github.com/ciatlas/flowpact/issues/141)) ([f6a5ffa](https://github.com/ciatlas/flowpact/commit/f6a5ffab8b0b726bd31ab761a5a38b2989b2b6b3)) ### Bug Fixes [#bug-fixes-13] * **impact:** note an ignore edit only for the units the pull request's ignore leaves out once merged ([#140](https://github.com/ciatlas/flowpact/issues/140)) ([746df9f](https://github.com/ciatlas/flowpact/commit/746df9f21b0a6aff30c73b7a670d1c91fddc77b0)) * **impact:** read a base config through links, submodules and letter case as the baseline has it, so a pull request can no longer leave a published unit out of impact mode with its own ignore ([#140](https://github.com/ciatlas/flowpact/issues/140)) ([746df9f](https://github.com/ciatlas/flowpact/commit/746df9f21b0a6aff30c73b7a670d1c91fddc77b0)) * **lint:** locate a finding's end, and a reference after a property that follows a dot and spaces, where the source has them ([#141](https://github.com/ciatlas/flowpact/issues/141)) ([f6a5ffa](https://github.com/ciatlas/flowpact/commit/f6a5ffab8b0b726bd31ab761a5a38b2989b2b6b3)) ## [0.16.0](https://github.com/ciatlas/flowpact/compare/v0.15.0...v0.16.0) (2026-10-14) [#0160-2026-10-14] ### Features [#features-13] * **rules:** FP104, FP105, FP106 and FP401 follow inputs read through github as GitHub does, with core 1.0.0; some findings change, see https://ciatlas.github.io/flowpact/docs/upgrading ([#137](https://github.com/ciatlas/flowpact/issues/137)) ([ce3c119](https://github.com/ciatlas/flowpact/commit/ce3c11930242be379f756dd4ff603e00551efe35)) ### Bug Fixes [#bug-fixes-14] * **rules:** FP104 reports the inputs of a workflow or composite action that reads github.event as a whole, and a dispatch input read only in the workflow's own input defaults or workflow_call outputs ([#137](https://github.com/ciatlas/flowpact/issues/137)) ([ce3c119](https://github.com/ciatlas/flowpact/commit/ce3c11930242be379f756dd4ff603e00551efe35)) * **rules:** FP106 reports a callee that reads a passed input only through github, also through a step's own env, and FP401 no longer reports such a condition ([#137](https://github.com/ciatlas/flowpact/issues/137)) ([ce3c119](https://github.com/ciatlas/flowpact/commit/ce3c11930242be379f756dd4ff603e00551efe35)) ## [0.15.0](https://github.com/ciatlas/flowpact/compare/v0.14.1...v0.15.0) (2026-10-13) [#0150-2026-10-13] ### Features [#features-14] * **graph:** flowpact graph <paths> draws the given workflows and actions and what they call ([#134](https://github.com/ciatlas/flowpact/issues/134)) ([a4223ac](https://github.com/ciatlas/flowpact/commit/a4223ac3e4fd777fde97a977059735ac17b768a0)) * **impact:** flowpact impact <paths>, lint/check --impact <paths> and the action's paths grade only the published workflows and actions within the paths, and say so in the report ([#134](https://github.com/ciatlas/flowpact/issues/134)) ([a4223ac](https://github.com/ciatlas/flowpact/commit/a4223ac3e4fd777fde97a977059735ac17b768a0)) ### Bug Fixes [#bug-fixes-15] * **check:** check and generate with paths report and remove a removed unit's orphaned contract ([#134](https://github.com/ciatlas/flowpact/issues/134)) ([a4223ac](https://github.com/ciatlas/flowpact/commit/a4223ac3e4fd777fde97a977059735ac17b768a0)) * **impact:** a run with paths or ignore no longer passes silently when a published unit it does not report on needs a higher impact; verdict and findings always agree ([#134](https://github.com/ciatlas/flowpact/issues/134)) ([a4223ac](https://github.com/ciatlas/flowpact/commit/a4223ac3e4fd777fde97a977059735ac17b768a0)) * **impact:** ignore leaves a published unit out of impact mode only when both the baseline's and the pull request's config ignore it ([#134](https://github.com/ciatlas/flowpact/issues/134)) ([a4223ac](https://github.com/ciatlas/flowpact/commit/a4223ac3e4fd777fde97a977059735ac17b768a0)) * **lint:** locate a reference after a string literal that spans lines, and a computed index inside another reference ([#131](https://github.com/ciatlas/flowpact/issues/131)) ([b288f87](https://github.com/ciatlas/flowpact/commit/b288f878429b1d90f15f345e4aa1dd67c7cf7b56)) * **rules:** FP203 and FP204 count a whole secrets read, or a callee whose reads are unknown, behind secrets: inherit, and no longer suggest removing it ([#131](https://github.com/ciatlas/flowpact/issues/131)) ([b288f87](https://github.com/ciatlas/flowpact/commit/b288f878429b1d90f15f345e4aa1dd67c7cf7b56)) * **rules:** match github.event.inputs and outputs in any case, as GitHub does ([#133](https://github.com/ciatlas/flowpact/issues/133)) ([c0a052b](https://github.com/ciatlas/flowpact/commit/c0a052bf58638854a9aacf5dc1918a9a51415d37)) * **trace:** label an action's output edge 'action output' ([#131](https://github.com/ciatlas/flowpact/issues/131)) ([b288f87](https://github.com/ciatlas/flowpact/commit/b288f878429b1d90f15f345e4aa1dd67c7cf7b56)) ## [0.14.1](https://github.com/ciatlas/flowpact/compare/v0.14.0...v0.14.1) (2026-10-13) [#0141-2026-10-13] ### Bug Fixes [#bug-fixes-16] * **rules:** FP104 counts a whole github.event.inputs read in a callee as reading the root's dispatch inputs ([#129](https://github.com/ciatlas/flowpact/issues/129)) ([d81d713](https://github.com/ciatlas/flowpact/commit/d81d71360e3b44cbdd5fb50df01ef7ab74bf59e5)) ## [0.14.0](https://github.com/ciatlas/flowpact/compare/v0.13.0...v0.14.0) (2026-10-13) [#0140-2026-10-13] ### Features [#features-15] * **trace:** follow input defaults, whole-object reads and github.event.inputs in workflows that can be called, and print each branch's note; some findings and contracts change, see https://ciatlas.github.io/flowpact/docs/upgrading ([#125](https://github.com/ciatlas/flowpact/issues/125)) ([4166c00](https://github.com/ciatlas/flowpact/commit/4166c00fe3f1e3c8e0c28486fbde8c7aa4a7dc5a)) ### Bug Fixes [#bug-fixes-17] * **lint:** locate a finding at the expression in a bare if: written as a block or quoted scalar ([#125](https://github.com/ciatlas/flowpact/issues/125)) ([4166c00](https://github.com/ciatlas/flowpact/commit/4166c00fe3f1e3c8e0c28486fbde8c7aa4a7dc5a)) * **lint:** no FP104 or FP203 for a read through a `*` filter, and no false FP404 for a matrix exclude item that is an expression ([#125](https://github.com/ciatlas/flowpact/issues/125)) ([4166c00](https://github.com/ciatlas/flowpact/commit/4166c00fe3f1e3c8e0c28486fbde8c7aa4a7dc5a)) * **lint:** report a value a called workflow reads only through github.event.inputs (FP106) ([#125](https://github.com/ciatlas/flowpact/issues/125)) ([4166c00](https://github.com/ciatlas/flowpact/commit/4166c00fe3f1e3c8e0c28486fbde8c7aa4a7dc5a)) ## [0.13.0](https://github.com/ciatlas/flowpact/compare/v0.12.3...v0.13.0) (2026-10-13) [#0130-2026-10-13] ### Features [#features-16] * **trace:** show the contexts and plain values a value comes from when tracing up ([#123](https://github.com/ciatlas/flowpact/issues/123)) ([ad17271](https://github.com/ciatlas/flowpact/commit/ad17271ac3bc5de01cc5c4ee0abd930a6148a8fb)) ## [0.12.3](https://github.com/ciatlas/flowpact/compare/v0.12.2...v0.12.3) (2026-10-12) [#0123-2026-10-12] ### Bug Fixes [#bug-fixes-18] * **lint:** never write through a symlinked directory in the repository ([#112](https://github.com/ciatlas/flowpact/issues/112)) ([1d8a570](https://github.com/ciatlas/flowpact/commit/1d8a570ac240889fba3e149e1c36c86f27c41da5)) ## [0.12.2](https://github.com/ciatlas/flowpact/compare/v0.12.1...v0.12.2) (2026-10-12) [#0122-2026-10-12] ### Performance [#performance] * **lint:** validate with zod/mini, without zod's code generation ([#108](https://github.com/ciatlas/flowpact/issues/108)) ([0d78300](https://github.com/ciatlas/flowpact/commit/0d78300f1dffe3040bea3ebd09e17a376f271e9c)) ## [0.12.1](https://github.com/ciatlas/flowpact/compare/v0.12.0...v0.12.1) (2026-10-12) [#0121-2026-10-12] ### Bug Fixes [#bug-fixes-19] * **core:** `always()` is known to be true, so a condition like `!always()` is known never to run ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** `impact.publish` lists each action once, finds `action.yaml` in an exact directory, and treats `./dir` like `dir` ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** a fractional array index is rounded down like GitHub, in expressions and matrix values ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** a step's own `env:` shadows the job's and the workflow's in that step's data flow ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** check names use GitHub's defaults for inputs without one, and are uncertain when a default is an expression ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** files whose names start with `..` are read, and locations before the start of a file are clamped ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** impact mode reads a base commit's linked files and directories like the working tree, bounded against loops and fan-out ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** keys named like `constructor` or `toString` are not treated as defined, and no longer hide a file's schema errors ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** matrix include and exclude entries tell object values with different keys apart ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** numbers convert to strings like GitHub (G15) in names, `format()`, `join()` and comparisons ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** the hint for a missing base like `origin/main` suggests `git fetch origin main` ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** the repository is detected from origin's url, not its pushurl ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) * **core:** walking the repository no longer loops on a directory linked into itself ([#94](https://github.com/ciatlas/flowpact/issues/94)) ([7756e28](https://github.com/ciatlas/flowpact/commit/7756e28879521de1dfcb1ae17f858b34dd797bcd)) ## [0.12.0](https://github.com/ciatlas/flowpact/compare/v0.11.1...v0.12.0) (2026-10-11) [#0120-2026-10-11] ### ⚠ BREAKING CHANGES [#-breaking-changes] * flowpact moved to the ciatlas organization. Use `uses: ciatlas/flowpact@v0.12` (GitHub redirects the old name). The docs and schemas are now at https://ciatlas.github.io/flowpact, and the old rumankazi.github.io/flowpact URLs no longer resolve. Contracts written by 0.11 or earlier name the old schema and docs URLs: run `flowpact generate` once, or `flowpact check` reports FP802. Releases up to 0.11.1 verify with `gh attestation verify --owner rumankazi`, or offline with the release's `.sigstore.json` bundle and `--repo rumankazi/flowpact`; `gh release verify` no longer finds their release attestations. See https://ciatlas.github.io/flowpact/docs/upgrading. ### Features [#features-17] * flowpact moves to ciatlas/flowpact and https://ciatlas.github.io/flowpact ([#90](https://github.com/ciatlas/flowpact/issues/90)) ([634431c](https://github.com/ciatlas/flowpact/commit/634431c224224755e36287c77e933ee1dc751dba)) ## [0.11.1](https://github.com/rumankazi/flowpact/compare/v0.11.0...v0.11.1) (2026-10-11) [#0111-2026-10-11] ### Bug Fixes [#bug-fixes-20] * **core:** treat an unquoted `if: false` as never running in FP401, FP402, FP404 and FP205 ([#86](https://github.com/rumankazi/flowpact/issues/86)) ([ccfb1c9](https://github.com/rumankazi/flowpact/commit/ccfb1c955abc7f6614e54a1a885e4cc0845ea610)) ## [0.11.0](https://github.com/rumankazi/flowpact/compare/v0.10.1...v0.11.0) (2026-10-11) [#0110-2026-10-11] ### Features [#features-18] * **cli:** every command's text in the API: formatGraph, formatTrace, formatRules, formatExplain, formatGeneration, Analysis.github() and terminalOptions() ([#84](https://github.com/rumankazi/flowpact/issues/84)) ([e076cb9](https://github.com/rumankazi/flowpact/commit/e076cb9f24f713ce0f23c3ad198723a2137c4185)) ### Bug Fixes [#bug-fixes-21] * **cli:** a fractional COLUMNS no longer makes flowpact lint fail ([#84](https://github.com/rumankazi/flowpact/issues/84)) ([e076cb9](https://github.com/rumankazi/flowpact/commit/e076cb9f24f713ce0f23c3ad198723a2137c4185)) ## [0.10.1](https://github.com/rumankazi/flowpact/compare/v0.10.0...v0.10.1) (2026-10-10) [#0101-2026-10-10] ### Bug Fixes [#bug-fixes-22] * **action:** name the plugin input's files that a run skips, and why ([#82](https://github.com/rumankazi/flowpact/issues/82)) ([fd6c359](https://github.com/rumankazi/flowpact/commit/fd6c3592ccfc53c3e460b620e90a20cf1e5d1f44)) * **action:** print no empty impact baseline group when impact mode does not run ([#82](https://github.com/rumankazi/flowpact/issues/82)) ([fd6c359](https://github.com/rumankazi/flowpact/commit/fd6c3592ccfc53c3e460b620e90a20cf1e5d1f44)) * **action:** warn when a copy of the action has an action.yml that cannot be read, instead of ignoring its defaults ([#82](https://github.com/rumankazi/flowpact/issues/82)) ([fd6c359](https://github.com/rumankazi/flowpact/commit/fd6c3592ccfc53c3e460b620e90a20cf1e5d1f44)) * **cli:** publish the npm package without devDependencies and scripts, so a vendored copy works in an npm workspace ([#82](https://github.com/rumankazi/flowpact/issues/82)) ([fd6c359](https://github.com/rumankazi/flowpact/commit/fd6c3592ccfc53c3e460b620e90a20cf1e5d1f44)) ## [0.10.0](https://github.com/rumankazi/flowpact/compare/v0.9.0...v0.10.0) (2026-10-10) [#0100-2026-10-10] ### ⚠ BREAKING CHANGES [#-breaking-changes-1] * **cli:** The npm package's `dist/index.js` now loads a second file next to it (code it shares with the new API), so a copy of `dist/index.js` alone no longer runs. Vendor the whole `package/` folder and run `node tools/flowpact/dist/index.js`; see https://rumankazi.github.io/flowpact/docs/upgrading. ### Features [#features-19] * **action:** base-config and plugin inputs, so an organization's copy of the action carries its defaults and rules ([#76](https://github.com/rumankazi/flowpact/issues/76)) ([442ff0b](https://github.com/rumankazi/flowpact/commit/442ff0be94b4f842ffb5f85cc45da63fae1360d4)) * **cli:** a programmatic API, one function per command, in the flowpact package ([#78](https://github.com/rumankazi/flowpact/issues/78)) ([9fae33a](https://github.com/rumankazi/flowpact/commit/9fae33a3c101126b2f8d1c4bb2279527449323ed)) ### Performance [#performance-1] * **action:** upload regenerated contracts without @actions/artifact, halving the action ([#77](https://github.com/rumankazi/flowpact/issues/77)) ([1beb611](https://github.com/rumankazi/flowpact/commit/1beb611fb91d447dd0b2743312280d7621d8cbed)) ## [0.9.0](https://github.com/rumankazi/flowpact/compare/v0.8.2...v0.9.0) (2026-10-10) [#090-2026-10-10] ### ⚠ BREAKING CHANGES [#-breaking-changes-2] * Options now go after the command. Before 0.9, an option written before it (`flowpact --no-plugins lint`) was silently dropped; it is now a usage error (exit 2). Write `flowpact lint --no-plugins`; `flowpact --help` and `flowpact --version` work as before. See https://rumankazi.github.io/flowpact/docs/upgrading. ### Features [#features-20] * **cli:** annotations, several reports in one run and plugin flags, for wrappers built on flowpact ([#70](https://github.com/rumankazi/flowpact/issues/70)) ([a9e81cc](https://github.com/rumankazi/flowpact/commit/a9e81ccb358842daf274a2d43e45eee7a782f5e7)) * **config:** organization defaults with --base-config, and rules that are not loaded no longer stop a run ([#73](https://github.com/rumankazi/flowpact/issues/73)) ([665f687](https://github.com/rumankazi/flowpact/commit/665f687187af93a400427e9a084e37f1028bf023)) ### Bug Fixes [#bug-fixes-23] * harden 0.9.0 before its release: flag values, plugins, report paths and release assets ([#74](https://github.com/rumankazi/flowpact/issues/74)) ([1dca54a](https://github.com/rumankazi/flowpact/commit/1dca54ac5f5843b0b8d80f1467eeffd94756943d)) ## [0.8.2](https://github.com/rumankazi/flowpact/compare/v0.8.1...v0.8.2) (2026-10-09) [#082-2026-10-09] ### Bug Fixes [#bug-fixes-24] * **core:** report an invalid expression once, as FP502 ([#65](https://github.com/rumankazi/flowpact/issues/65)) ([fd8cd1a](https://github.com/rumankazi/flowpact/commit/fd8cd1afb241c3ad13d37171c7edb35ac8e4d98f)) ## [0.8.1](https://github.com/rumankazi/flowpact/compare/v0.8.0...v0.8.1) (2026-10-09) [#081-2026-10-09] ### Bug Fixes [#bug-fixes-25] * **vscode:** load the Marketplace screenshots from raw.githubusercontent.com ([#62](https://github.com/rumankazi/flowpact/issues/62)) ([a3ef6a3](https://github.com/rumankazi/flowpact/commit/a3ef6a3b65a22de3be1afa62a5cf21a085299d13)) ## [0.8.0](https://github.com/rumankazi/flowpact/compare/v0.7.0...v0.8.0) (2026-10-09) [#080-2026-10-09] ### ⚠ BREAKING CHANGES [#-breaking-changes-3] * **core:** FP105, FP205, FP401, FP402 and FP404 no longer report empty values the workflow handles, so overrides for those findings are reported by FP902 ([#58](https://github.com/rumankazi/flowpact/issues/58)). Some of their messages changed, so those code-scanning alerts close and reopen once. See https://rumankazi.github.io/flowpact/docs/upgrading. * **core:** run `flowpact generate` after upgrading if you lock contracts ([#56](https://github.com/rumankazi/flowpact/issues/56)): a read of a whole outputs object such as `toJSON(needs.build.outputs)` now counts every output in it, so `flowpact check` reports contracts written by 0.7 as outdated (FP802). FP303 no longer reports outputs of published units, and rules about the internals of generated files are skipped there, so overrides for those findings are reported by FP902. See https://rumankazi.github.io/flowpact/docs/upgrading. * **core:** a step's `uses: ./path` now resolves against the runner's workspace, as GitHub does ([#55](https://github.com/rumankazi/flowpact/issues/55)). Contracts of repositories that use actions through a checkout `path:` or `$/` gain `uses` entries, so `flowpact check` reports FP802 until you run `flowpact generate`; overrides for the old false FP606 findings are reported by FP902. See https://rumankazi.github.io/flowpact/docs/upgrading. ### Features [#features-21] * **core:** precise output tracking for FP303/FP304, and quiet internals of generated files ([#56](https://github.com/rumankazi/flowpact/issues/56)) ([ac647a7](https://github.com/rumankazi/flowpact/commit/ac647a7691a127063ec183a1956ef6e2a4762c95)) * **core:** resolve step `uses: ./` against the workspace and support `$/` ([#55](https://github.com/rumankazi/flowpact/issues/55)) ([22fa1eb](https://github.com/rumankazi/flowpact/commit/22fa1eb6c6f7f59ee4a7190f9190480ead5a1253)) * **lsp:** a compact hover card with a flowpact header and docs link ([#49](https://github.com/rumankazi/flowpact/issues/49)) ([ecf6405](https://github.com/rumankazi/flowpact/commit/ecf64050a7d328c444968759ce1ad91daa8883ca)) ### Bug Fixes [#bug-fixes-26] * **cli:** generate only the contracts of the given paths, and link the docs from --help ([#50](https://github.com/rumankazi/flowpact/issues/50)) ([bafeb74](https://github.com/rumankazi/flowpact/commit/bafeb74f6df5d3c9b92996d3ac07af05298f1e59)) * **core:** accept background steps and cache-mode, warn on keys GitHub ignores ([#52](https://github.com/rumankazi/flowpact/issues/52)) ([c58aaa6](https://github.com/rumankazi/flowpact/commit/c58aaa694137cd44f647a13eef76334c9a8443fc)) * **core:** stop reporting empty values the workflow already handles ([#58](https://github.com/rumankazi/flowpact/issues/58)) ([8f7c946](https://github.com/rumankazi/flowpact/commit/8f7c9465b456ded90bf04163a7a87782ec471624)) * **rules:** allow a job-level if to read jobs it depends on indirectly (FP302) ([#57](https://github.com/rumankazi/flowpact/issues/57)) ([d70dabc](https://github.com/rumankazi/flowpact/commit/d70dabca3387891b744b2f77dd23fd0195277199)) * **vscode:** activate without a workspace search when workflows are at the root ([#53](https://github.com/rumankazi/flowpact/issues/53)) ([5ea2e64](https://github.com/rumankazi/flowpact/commit/5ea2e648edb359e30008711767beb4e018e6fa25)) ## [0.7.0](https://github.com/rumankazi/flowpact/compare/v0.6.0...v0.7.0) (2026-10-08) [#070-2026-10-08] ### Features [#features-22] * **brand:** add the flowpact logo ([#46](https://github.com/rumankazi/flowpact/issues/46)) ([485f6d8](https://github.com/rumankazi/flowpact/commit/485f6d828a73798a0998e39bab87f696165dbfa8)) ## [0.6.0](https://github.com/rumankazi/flowpact/compare/v0.5.0...v0.6.0) (2026-10-08) [#060-2026-10-08] ### Features [#features-23] * **vscode:** add the VS Code extension ([#39](https://github.com/rumankazi/flowpact/issues/39)) ([e80a59a](https://github.com/rumankazi/flowpact/commit/e80a59ad1e9b7c2b1ce204b34e9372e97b29fe9f)) ## [0.5.0](https://github.com/rumankazi/flowpact/compare/v0.4.0...v0.5.0) (2026-10-08) [#050-2026-10-08] ### Features [#features-24] * **core:** find symbols by source position for editors ([#34](https://github.com/rumankazi/flowpact/issues/34)) ([c8220d2](https://github.com/rumankazi/flowpact/commit/c8220d2ff48af010411c5a7594101fe985ba29b2)) * **lsp:** add the language server and `flowpact lsp` ([#35](https://github.com/rumankazi/flowpact/issues/35)) ([17b422f](https://github.com/rumankazi/flowpact/commit/17b422f44c74d464657daba40fd89a0cc23e1c2d)) ## [0.4.0](https://github.com/rumankazi/flowpact/compare/v0.3.2...v0.4.0) (2026-10-08) [#040-2026-10-08] ### ⚠ BREAKING CHANGES [#-breaking-changes-4] * remove the wfc migration support ([#30](https://github.com/rumankazi/flowpact/issues/30)) ### Refactoring [#refactoring] * remove the wfc migration support ([#30](https://github.com/rumankazi/flowpact/issues/30)) ([0f5b667](https://github.com/rumankazi/flowpact/commit/0f5b6677ca25a921e523738d164c39f18f524927)) ## [0.3.2](https://github.com/rumankazi/flowpact/compare/v0.3.1...v0.3.2) (2026-10-08) [#032-2026-10-08] ### Bug Fixes [#bug-fixes-27] * close the gaps the review of the code-scanning fixes found ([#27](https://github.com/rumankazi/flowpact/issues/27)) ([c3ae275](https://github.com/rumankazi/flowpact/commit/c3ae27589393d4da00d9c8814fe88d1e55cce12a)) ## [0.3.1](https://github.com/rumankazi/flowpact/compare/v0.3.0...v0.3.1) (2026-10-08) [#031-2026-10-08] ### Bug Fixes [#bug-fixes-28] * resolve the open code-scanning alerts ([#25](https://github.com/rumankazi/flowpact/issues/25)) ([05ae008](https://github.com/rumankazi/flowpact/commit/05ae008f6fee0b5fd7b5377a8f2e08be256fa7ef)) ## [0.3.0](https://github.com/rumankazi/flowpact/compare/v0.2.1...v0.3.0) (2026-10-08) [#030-2026-10-08] ### Features [#features-25] * impact mode for publishers of reusable workflows and actions ([#20](https://github.com/rumankazi/flowpact/issues/20)) ([9531d70](https://github.com/rumankazi/flowpact/commit/9531d70127b445baaf90359142efda9a8148e5db)) ## [0.2.1](https://github.com/rumankazi/flowpact/compare/v0.2.0...v0.2.1) (2026-10-08) [#021-2026-10-08] ### Bug Fixes [#bug-fixes-29] * **reporters:** leave findings accepted by overrides out of SARIF ([#21](https://github.com/rumankazi/flowpact/issues/21)) ([efb84ee](https://github.com/rumankazi/flowpact/commit/efb84ee6468248c48fb3a1ac6eba3d38c0884ed4)) ## [0.2.0](https://github.com/rumankazi/flowpact/compare/v0.1.1...v0.2.0) (2026-10-08) [#020-2026-10-08] ### ⚠ BREAKING CHANGES [#-breaking-changes-5] * rename wfc to flowpact ([#18](https://github.com/rumankazi/flowpact/issues/18)) ### Features [#features-26] * rename wfc to flowpact ([#18](https://github.com/rumankazi/flowpact/issues/18)) ([b7d04b9](https://github.com/rumankazi/flowpact/commit/b7d04b9cf78679250aa09e731dae4aedb77d451b)) ## [0.1.1](https://github.com/rumankazi/wfc/compare/v0.1.0...v0.1.1) (2026-10-08) [#011-2026-10-08] ### Bug Fixes [#bug-fixes-30] * **action:** shorten the description to fit the GitHub Marketplace limit ([#5](https://github.com/rumankazi/wfc/issues/5)) ([2ea93bb](https://github.com/rumankazi/wfc/commit/2ea93bb5bc7073046a26292c7da849ee21ad9445)) ## [0.1.0] — 2026-10-08 [#010--2026-10-08] First release. ### Engine [#engine] - Parses workflows and local composite/JavaScript/Docker actions into a data-flow graph with exact source positions: inputs, secrets, env, matrix keys and outputs across nested reusable workflows, same-repository `owner/repo@ref` references, YAML anchors and aliases. - Uses GitHub's own `@actions/expressions` and `@actions/workflow-parser` for expressions and schema validation. - Expands matrices exactly like GitHub (`include`/`exclude`) and evaluates bindings per combination, honouring each job's and step's own `if:`. ### Rules (45) [#rules-45] - `WFC1xx` inputs, `WFC2xx` secrets, `WFC3xx` outputs, `WFC4xx` matrix, `WFC5xx` expressions, env, schema and context availability, `WFC6xx` structure, `WFC8xx` contracts, `WFC9xx` overrides. Every finding has a code, location, call chain, why, fix and docs link. ### Contracts [#contracts] - `wfc generate` writes a deterministic, semantic contract per workflow and local action to `.github/workflow-contracts/`; `wfc check` reports drift and classifies breaking changes; `--patch` writes a `git apply`-able patch. ### Configuration [#configuration] - `.github/workflow-contracts/wfc.config.yml` with rule severities, limits, ignored paths, overrides (mandatory reason, optional expiry and owner), declared shapes for runtime-computed matrices, and plugins. JSON Schemas for the config, contracts and the JSON report are published at `https://rumankazi.github.io/wfc/schemas/`. ### CLI (`npx workflow-contracts`, command `wfc`) [#cli-npx-workflow-contracts-command-wfc] - `lint`, `check`, `generate`, `trace`, `graph`, `explain`, `rules`; pretty, JSON, Markdown and SARIF output; reports to files; debug logging; exit codes 0 (clean), 1 (findings), 2 (usage/config error), 3 (internal error). ### GitHub Action (`rumankazi/wfc@v0`) [#github-action-rumankaziwfcv0] - Job summary, pull request annotations, JSON/SARIF/Markdown reports, and — in check mode — the regenerated contracts plus a patch as a downloadable artifact for people who cannot run the CLI. [0.1.0]: https://github.com/rumankazi/wfc/releases/tag/v0.1.0 # CI usage (https://ciatlas.github.io/flowpact/docs/ci) ## The flowpact action [#the-flowpact-action] The simplest setup is the [flowpact GitHub Action](https://ciatlas.github.io/flowpact/docs/action). It runs the same engine as the CLI and adds a job summary, inline annotations on the pull request and — when contracts drifted — the regenerated contracts as a downloadable artifact. ```yaml title=".github/workflows/flowpact.yml" name: Workflow contracts on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: ciatlas/flowpact@v0.29 with: mode: check # or lint, if you do not commit contracts ``` The workflow runs on every pull request. If you make the flowpact job a required status check, do not add a `paths:` filter: a pull request that touches none of the paths skips the workflow, and GitHub then leaves the required check pending, so the pull request cannot merge ([GitHub docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks)). To filter a check that is not required, list everything flowpact reads: `'.github/workflows/**'`, `'.github/flowpact/**'`, `'**/action.yml'` and `'**/action.yaml'` (a local action can live anywhere, including the repository root). Each finding is an annotation on the line it is about, in the pull request's **Files changed** tab: {/* Captured by hand, signed out, from https://github.com/ciatlas/flowpact-demo/pull/1/files (light and dark). */} [The demo pull request](https://github.com/ciatlas/flowpact-demo/pull/1) shows the rest: the Windows leg is skipped and the pipeline stays green, while the flowpact check fails. See [GitHub Action](https://ciatlas.github.io/flowpact/docs/action) for every input and output (`fail-on`, SARIF upload, the contracts artifact, …). ## The CLI in GitHub Actions [#the-cli-in-github-actions] The CLI works in any job that has Node.js: ```yaml title=".github/workflows/flowpact.yml" name: Workflow contracts on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 22 - name: Check workflows and contracts run: >- npx --yes flowpact check --format github -o markdown:"$GITHUB_STEP_SUMMARY" --patch flowpact-contracts.patch - name: Keep the regenerated contracts if: always() uses: actions/upload-artifact@v7 with: name: flowpact-contracts path: flowpact-contracts.patch if-no-files-found: ignore ``` - Use `flowpact lint` instead of `flowpact check` if you do not commit [contracts](https://ciatlas.github.io/flowpact/docs/contracts). - `--format github` annotates each finding on its file and line, in the run and the pull request, like the [action](https://ciatlas.github.io/flowpact/docs/action#annotations). Leave it out to print the terminal report in the job log instead (GitHub's log viewer keeps its colors). - `-o markdown:"$GITHUB_STEP_SUMMARY"` writes the Markdown report to the job summary. `-o` can be repeated, e.g. `-o flowpact.sarif` for [code scanning](#code-scanning-sarif) or `-o flowpact-report.json` for a machine-readable report. - The step fails (exit `1`) when there are errors, which in `flowpact check` includes missing, outdated, breaking, orphaned and invalid contracts. Use `--fail-on warning` to be stricter or `--fail-on never` to report without failing. - `--patch` writes `flowpact-contracts.patch` only when contracts drifted. Anyone can download it from the run and apply it with `git apply flowpact-contracts.patch` — no local Node.js needed. - When you re-run a job with **debug logging enabled**, GitHub sets `RUNNER_DEBUG=1` and flowpact switches to debug logs automatically. ### Code scanning (SARIF) [#code-scanning-sarif] To see findings in the **Security → Code scanning** tab and as pull request annotations, write SARIF and upload it: ```yaml permissions: contents: read security-events: write steps: # …checkout and setup-node as above - run: npx --yes flowpact check --output flowpact.sarif - if: always() uses: github/codeql-action/upload-sarif@v4 with: sarif_file: flowpact.sarif category: flowpact ``` ### Pin the version [#pin-the-version] ```sh npx --yes flowpact@0.29 check ``` The banner at the top of the log shows the exact tool and schema versions that produced the result. ## Other CI systems [#other-ci-systems] flowpact only needs Node.js and the repository files: ```sh npx --yes flowpact check --format json --output flowpact-report.json --patch flowpact-contracts.patch ``` # Comparison (https://ciatlas.github.io/flowpact/docs/comparison) flowpact reports what happens between files and matrix combinations: values written in the YAML that arrive empty, with no error from GitHub and nothing from actionlint or GitHub's VS Code extension. It also checks calls into other repositories against a committed lockfile, in CI too, and grades a new version before you take it. actionlint checks each file in more depth (shell scripts, expression types, runner labels), so use both. What each tool reports, from small test repositories and the tools' own documentation: | Problem | actionlint | GitHub Actions extension¹ | flowpact | | --- | --- | --- | --- | | One matrix combination passes an empty value, because an `include` entry lacks a key | — | — | ✓ names the combination ([`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401), [`FP402`](https://ciatlas.github.io/flowpact/docs/rules/fp402)) | | An optional input with no default is left out: a step is skipped, or a required input further down gets `''` | — | — | ✓ [`FP105`](https://ciatlas.github.io/flowpact/docs/rules/fp105), [`FP107`](https://ciatlas.github.io/flowpact/docs/rules/fp107) | | A reusable workflow reads a secret it does not declare | only if it declares other secrets; also reports reads that `secrets: inherit` makes valid | — | ✓ counts the callers that do not inherit ([`FP205`](https://ciatlas.github.io/flowpact/docs/rules/fp205)) | | A step's local action is not where the step runs: a path typo, or a checkout into a subdirectory | — | — | ✓ [`FP606`](https://ciatlas.github.io/flowpact/docs/rules/fp606) | | A composite action reads an input it does not declare | — (does not lint `action.yml`) | — | ✓ suggests the declared name ([`FP108`](https://ciatlas.github.io/flowpact/docs/rules/fp108)) | | An output arrives empty: its step never writes it, or a nested workflow no longer has it | — | nested workflow only | ✓ [`FP304`](https://ciatlas.github.io/flowpact/docs/rules/fp304), [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301) | | A matrix built with `fromJSON` is read with a key it never has | — | — | ✓ once you declare its keys ([`FP403`](https://ciatlas.github.io/flowpact/docs/rules/fp403), [`FP404`](https://ciatlas.github.io/flowpact/docs/rules/fp404)) | | GitHub rejects the run: a call cycle, a call chain of more than 10 workflows, more than 256 matrix jobs | — | — | ✓ [`FP601`](https://ciatlas.github.io/flowpact/docs/rules/fp601), [`FP602`](https://ciatlas.github.io/flowpact/docs/rules/fp602), [`FP406`](https://ciatlas.github.io/flowpact/docs/rules/fp406) | | GitHub rejects the run: a job of a called workflow, or of a workflow it calls, requests a `GITHUB_TOKEN` permission the call does not grant | — | — | ✓ names the job and each scope, raises the grant in a quick fix, and checks remote workflows against the [lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) ([`FP613`](https://ciatlas.github.io/flowpact/docs/rules/fp613)) | | Inputs, outputs and secrets nothing reads, and which secrets a `secrets: inherit` call actually needs | — | — | ✓ [`FP104`](https://ciatlas.github.io/flowpact/docs/rules/fp104), [`FP106`](https://ciatlas.github.io/flowpact/docs/rules/fp106), [`FP203`](https://ciatlas.github.io/flowpact/docs/rules/fp203), [`FP303`](https://ciatlas.github.io/flowpact/docs/rules/fp303), [`FP204`](https://ciatlas.github.io/flowpact/docs/rules/fp204) | | A published workflow changes an input, an output or a check name that consumers in other repositories may depend on | — | — | ✓ against the committed [contract](https://ciatlas.github.io/flowpact/docs/contracts) (`FP803`) or the pull request's base in [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) (`FP810`); it does not read the consumers | | Where a value comes from and where it goes, across files | — | — (no go to definition or references) | ✓ `flowpact trace`, hover, go to definition, references | | A workflow reads an `env` variable that nothing sets | — | ✓ also warns on a valid `$GITHUB_ENV` write earlier in the job | only if no action step, such as `actions/checkout`, comes before the read ([`FP501`](https://ciatlas.github.io/flowpact/docs/rules/fp501)) | | A call to a local reusable workflow or local action leaves out a required input or secret, or passes an unknown input or a literal of the wrong type | ✓ | local reusable workflows only, when signed in; no type check | ✓ suggests the declared name ([`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101)–[`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103), [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201)) | | A matrix key that no combination defines | ✓ | ✓ | ✓ [`FP404`](https://ciatlas.github.io/flowpact/docs/rules/fp404) | | A `${{ }}` expression that does not parse, or calls a function with the wrong number of arguments | ✓ | ✓ | ✓ [`FP502`](https://ciatlas.github.io/flowpact/docs/rules/fp502) | | A context used where GitHub does not allow it, such as `secrets` in a job's `if:` | ✓ | ✓ | ✓ [`FP505`](https://ciatlas.github.io/flowpact/docs/rules/fp505) | | A call to an action or reusable workflow in another repository leaves out a required input, or passes an input or secret it does not declare | ✓ for popular actions such as `actions/checkout`, from data built into actionlint; not for reusable workflows | ✓ when signed in, against the version on GitHub while you edit; no type check | ✓ against the committed [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces), also in CI and without network, with the type of a literal ([`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101)–[`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103), [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201), [`FP202`](https://ciatlas.github.io/flowpact/docs/rules/fp202)); without an entry, a remote reusable workflow call is reported as unverified ([`FP603`](https://ciatlas.github.io/flowpact/docs/rules/fp603)) | | A new version of an action or reusable workflow in another repository breaks one of your calls: a tag moved, or a bot's pull request moves the reference | — | — (it checks the version on GitHub when you next edit the file) | ✓ graded before you take it, on the pull request that moves the reference and in a scheduled drift check ([When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes)) | | A property that a built-in context does not have, such as `github.reff` or `runner.oss` | ✓ | ✓ as a warning | — | | An expression whose type does not fit, such as `${{ github.ref_name }}` (a string) in `timeout-minutes`, or an object in `${{ }}` | ✓ | — (only a literal such as `${{ 'abc' }}`) | — (only a literal, [`FP503`](https://ciatlas.github.io/flowpact/docs/rules/fp503)) | | A cron schedule that is invalid (hour 25) or runs more often than every 5 minutes | ✓ | ✓ | — | | A runner label that does not exist, such as `ubuntu-latst`, or was retired, such as `ubuntu-18.04` | ✓ | — | — | | Bugs in `run:` scripts, such as an unquoted variable | ✓ runs shellcheck when it is installed | — | — | | Security: script injection, excessive permissions, pinning ([zizmor](https://github.com/zizmorcore/zizmor) covers these) | script injection and hard-coded credentials | not compared | — | ¹ GitHub Actions extension 0.31.5 through its language server; for calls into other repositories, language server 0.3.60 from extension 0.32.3 (2026-10-15). It checks calls to reusable workflows and remote actions only when you are signed in, and calls to local reusable workflows only when GitHub also returns the workspace's repository; otherwise it misses them and can warn about outputs that exist. It reports nothing for local composite actions. ## Side by side [#side-by-side] Each case is a small repository, with its files in the tabs after flowpact's output. actionlint 1.7.12 and `flowpact lint` ran at its root (`NO_COLOR=1`); the outputs are unchanged apart from flowpact's banner and summary. GitHub's extension 0.31.5 ran signed in and not; what it reported is in the text. ### One matrix entry lacks a key that a reusable workflow requires [#one-matrix-entry-lacks-a-key-that-a-reusable-workflow-requires] The windows entry has no `config`, so the windows leg passes an empty `config` and runs `./scripts/integration.sh --config ""`. The `config:` key is present under `with:`, so GitHub's required-input check passes, and so does actionlint's. GitHub's extension reports nothing. This is the incident that started flowpact. **actionlint:** no output. ```text ── .github/workflows/ci.yml ─────────────────────────────────────────────────────────────── 1 error ✖ ERROR FP401 empty-binding-for-matrix-combo Input "config" for .github/workflows/integration.yml is empty in 1 of 3 matrix combinations — matrix.config is not defined there ▶ .github/workflows/ci.yml:23:19 21 │ with: 22 │ runner: ${{ matrix.runner }} 23 │ config: ${{ matrix.config }} │ ━━━━━━━━━━━━━ matrix { platform: windows, runner: windows-latest } context ├─ .github/workflows/ci.yml:18:13 this include entry has no `config` └─ .github/workflows/integration.yml:8:7 receives the empty value: input "config" why GitHub evaluates a missing matrix key to an empty string — no error, no warning. The affected matrix leg runs with an empty input, so the callee may skip its real work (e.g. a test configuration) while the run stays green. fix Set `config` in every combination, or use a fallback: `${{ matrix.config || '' }}`. docs https://ciatlas.github.io/flowpact/docs/rules/fp401 ``` ```yaml title=".github/workflows/ci.yml" name: CI on: pull_request: push: branches: [main] jobs: integration: strategy: matrix: include: - platform: linux runner: ubuntu-latest config: ci/linux.json - platform: macos runner: macos-latest config: ci/macos.json - platform: windows runner: windows-latest uses: ./.github/workflows/integration.yml with: runner: ${{ matrix.runner }} config: ${{ matrix.config }} ``` ```yaml title=".github/workflows/integration.yml" name: Integration tests on: workflow_call: inputs: runner: type: string required: true config: type: string required: true jobs: test: runs-on: ${{ inputs.runner }} steps: - uses: actions/checkout@v4 - run: ./scripts/integration.sh --config "${{ inputs.config }}" ``` ### An include entry left over after a runner upgrade starts a job of its own [#an-include-entry-left-over-after-a-runner-upgrade-starts-a-job-of-its-own] An `include` entry that joins no combination becomes a new one. `os: windows-2022` matches no `os`, so it starts a job of its own, and the windows-2025 job runs `./scripts/package.sh --format` with an empty `archive`. actionlint treats `archive` as defined because some entries set it; GitHub's extension reports nothing. flowpact expands the matrix as GitHub does and names the combination without the key. **actionlint:** no output. ```text ── .github/workflows/package.yml ──────────────────────────────────────────────────────── 1 warning ▲ WARN FP402 matrix-key-missing-in-combo matrix.archive is undefined in 1 of 4 combinations of jobs.package ▶ .github/workflows/package.yml:21:48 19 │ steps: 20 │ - uses: actions/checkout@v4 21 │ - run: ./scripts/package.sh --format ${{ matrix.archive }} │ ━━━━━━━━━━━━━━ 22 │ shell: bash matrix { os: windows-2025 } context └─ .github/workflows/package.yml:10:7 matrix defined here; `archive` is not set for every combination why In combinations without the key the value is an empty string. Scripts, env vars and runner labels built from it silently degrade (e.g. `--config=` with no value). fix Define the key for every combination, or add a fallback (`${{ matrix.key || 'default' }}`). Not reported: conditions (`if:`) and `continue-on-error`, comparisons and negations (`matrix.key != ''`, `!matrix.key`), `matrix.key && ...` guards, quoted shell tests in `run:` scripts (`[[ -z "${{ matrix.key }}" ]]`, `[ "${{ matrix.key }}" = on ]`), and combinations where the job or step is skipped by its own `if:`. docs https://ciatlas.github.io/flowpact/docs/rules/fp402 ``` ```yaml title=".github/workflows/package.yml" name: Package on: push: tags: ['v*'] jobs: package: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-24.04, macos-15, windows-2025] include: - os: ubuntu-24.04 archive: tar.gz - os: macos-15 archive: tar.gz - os: windows-2022 archive: zip steps: - uses: actions/checkout@v4 - run: ./scripts/package.sh --format ${{ matrix.archive }} shell: bash ``` ### An optional input decides an `if:`, and the caller leaves it out [#an-optional-input-decides-an-if-and-the-caller-leaves-it-out] ci.yml does not pass `push-image`, an optional string with no default, so `if: inputs.push-image` is false: the image is built on every push to main, never published, and the run is green. actionlint and GitHub's extension report nothing. With `type: boolean`, flowpact stays quiet too: the default is then `false`, and leaving it out is an opt-in. **actionlint:** no output. ```text ── .github/workflows/release.yml ──────────────────────────────────────────────────────── 1 warning ▲ WARN FP105 optional-input-no-default-in-condition Condition reads optional input "push-image", which has no default and is '' when omitted ▶ .github/workflows/release.yml:19:13 17 │ - uses: actions/checkout@v4 18 │ - run: docker build -t "ghcr.io/acme/app:${{ inputs.version }}" . 19 │ - if: inputs.push-image │ ━━━━━━━━━━━━━━━━━ 20 │ run: docker push "ghcr.io/acme/app:${{ inputs.version }}" context ├─ .github/workflows/release.yml:8:7 declared optional without a default └─ .github/workflows/ci.yml:8:11 .github/workflows/ci.yml › jobs.release omits it why When a caller omits an optional input that has no default, GitHub passes an empty string. A condition such as `if: inputs.deploy` then takes the "false" branch: the job or step is skipped and the run is still green, so nothing tells the caller that the value they left out turned it off. fix If it must run, make the input `required: true` or give it a non-empty `default`. If skipping is intended, say so where it is decided: `inputs.x != ''` (the same at run time, but explicit), or read the skipped step's outputs through a fallback (`steps.token.outputs.token || github.token`). `default: ''` is not a fix: it is what GitHub passes for an omitted input. docs https://ciatlas.github.io/flowpact/docs/rules/fp105 ``` ```yaml title=".github/workflows/ci.yml" name: CI on: push: branches: [main] jobs: release: uses: ./.github/workflows/release.yml with: version: ${{ github.sha }} ``` ```yaml title=".github/workflows/release.yml" name: Release on: workflow_call: inputs: version: type: string required: true push-image: description: Push the image to the registry after building it type: string required: false jobs: image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: docker build -t "ghcr.io/acme/app:${{ inputs.version }}" . - if: inputs.push-image run: docker push "ghcr.io/acme/app:${{ inputs.version }}" ``` ### A required input is fed from an optional input nobody sets [#a-required-input-is-fed-from-an-optional-input-nobody-sets] release.yml passes `environment: ${{ inputs.environment }}` to deploy.yml, but ci.yml never sets release.yml's optional `environment`, so deploy.yml's required input arrives empty. Each file is valid on its own; the value is lost between them. actionlint sees `environment:` present in each call; GitHub's extension reports nothing. **actionlint:** no output. ```text ── .github/workflows/release.yml ──────────────────────────────────────────────────────── 1 warning ▲ WARN FP107 optional-forwarded-to-required Required input "environment" of .github/workflows/deploy.yml is empty when optional input "environment" is omitted ▶ .github/workflows/release.yml:11:24 9 │ uses: ./.github/workflows/deploy.yml 10 │ with: 11 │ environment: ${{ inputs.environment }} │ ━━━━━━━━━━━━━━━━━━ context ├─ .github/workflows/release.yml:4:7 optional, no default └─ .github/workflows/deploy.yml:4:7 required by .github/workflows/deploy.yml why The call looks complete, so GitHub never complains about the required input, but when the outer caller omits the optional value the callee receives an empty string. The "required" guarantee is lost one level up. fix Make the outer input required too, give it a non-empty default, or add a non-empty fallback: `${{ inputs.x || 'value' }}`. If the callee handles an empty value, make its input `required: false`. If the call is pointless without the value, skip it with `if: inputs.x != ''`. docs https://ciatlas.github.io/flowpact/docs/rules/fp107 ``` ```yaml title=".github/workflows/ci.yml" on: push jobs: release: uses: ./.github/workflows/release.yml ``` ```yaml title=".github/workflows/release.yml" on: workflow_call: inputs: environment: type: string required: false jobs: deploy: uses: ./.github/workflows/deploy.yml with: environment: ${{ inputs.environment }} ``` ```yaml title=".github/workflows/deploy.yml" on: workflow_call: inputs: environment: type: string required: true jobs: run: runs-on: ubuntu-latest steps: - run: echo "deploying to ${{ inputs.environment }}" ``` ### A composite action reads a misspelled input [#a-composite-action-reads-a-misspelled-input] `inputs.enviroment` is not declared, so the action runs `./scripts/deploy.sh --env ""` although the caller passes `environment: production`. actionlint does not lint `action.yml`, and GitHub's extension reports nothing. flowpact reports the typo with the declared name, and that the declared input is never read. **actionlint:** no output. ```text ── .github/actions/deploy/action.yml ─────────────────────────────────────────── 1 error, 1 warning ▲ WARN FP104 unused-input Input "environment" of .github/actions/deploy is never read (yet 1 caller passes it) ▶ .github/actions/deploy/action.yml:4:3 2 │ description: Deploy the site to one environment 3 │ inputs: 4 │ environment: │ ━━━━━━━━━━━ 5 │ description: Target environment context └─ .github/workflows/deploy.yml:13:11 passed here why Dead inputs accumulate in large interfaces: callers keep computing and passing values that go nowhere, and readers assume a knob works when it does not. fix Remove the input (and the callers’ bindings), or wire it to where it was meant to be used. docs https://ciatlas.github.io/flowpact/docs/rules/fp104 ✖ ERROR FP108 undefined-input-ref .github/actions/deploy has no input "enviroment" — did you mean "environment"? ▶ .github/actions/deploy/action.yml:11:43 9 │ steps: 10 │ - shell: bash 11 │ run: ./scripts/deploy.sh --env "${{ inputs.enviroment }}" │ ━━━━━━━━━━━━━━━━━ why Undeclared inputs always evaluate to an empty value. This is usually a typo or a rename that missed a usage. fix Use `inputs.environment`. docs https://ciatlas.github.io/flowpact/docs/rules/fp108 ``` ```yaml title=".github/workflows/deploy.yml" name: Deploy on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ./.github/actions/deploy with: environment: production ``` ```yaml title=".github/actions/deploy/action.yml" name: Deploy description: Deploy the site to one environment inputs: environment: description: Target environment required: true runs: using: composite steps: - shell: bash run: ./scripts/deploy.sh --env "${{ inputs.enviroment }}" ``` ### A local action after a checkout into a subdirectory [#a-local-action-after-a-checkout-into-a-subdirectory] A step's `./` path resolves against the workspace, not the repository. The checkout writes the repository to `src`, so nothing is at `./.github/actions/setup-node` and the step fails when it is reached. actionlint resolves `./` against the repository root and reports nothing; neither does GitHub's extension. flowpact maps the path through the checkout and suggests the paths that work. A typo in the path is the same rule. **actionlint:** no output. ```text warn flowpact:load local reference outside the workspace ./.github/actions/setup-node {"from":".github/workflows/ci.yml"} ── .github/workflows/ci.yml ─────────────────────────────────────────────────────────────── 1 error ✖ ERROR FP606 missing-local-target Action ".github/actions/setup-node" is not in the workspace (this repository is checked out at "src", not at the workspace root) ▶ .github/workflows/ci.yml:9:15 7 │ with: 8 │ path: src 9 │ - uses: ./.github/actions/setup-node │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10 │ - run: npm test context └─ .github/workflows/ci.yml:6:15 checks this repository out at "src" why The job or step fails as soon as it is reached, usually after a rename or move. A step’s `./path` is relative to the runner’s workspace: flowpact maps it through the `actions/checkout` steps before it (for a composite action, each caller’s) and reports it when it lands in this repository but is missing, or when no checkout puts this repository where it points. Paths it cannot read are FP610. fix A step’s ./path is relative to the workspace, where this repository is at "src": a path in it starts with ./src/. Or use $/.github/actions/setup-node, which always means this repository. docs https://ciatlas.github.io/flowpact/docs/rules/fp606 ``` ```yaml title=".github/workflows/ci.yml" on: push jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: path: src - uses: ./.github/actions/setup-node - run: npm test working-directory: src ``` ```yaml title=".github/actions/setup-node/action.yml" name: Setup Node description: Install Node and dependencies runs: using: composite steps: - uses: actions/setup-node@v4 with: node-version: 22 - run: npm ci shell: bash ``` ### A reusable workflow declares one secret and reads another [#a-reusable-workflow-declares-one-secret-and-reads-another] A called workflow sees only the secrets passed to it, so `./publish.sh` runs without `NPM_TOKEN`. actionlint and flowpact both report it, at the same position: actionlint an undefined property of `secrets`, flowpact an empty value, with the callers that do not use `secrets: inherit`. GitHub's extension reports nothing. ```text ── .github/workflows/publish.yml ────────────────────────────────────────────────────────── 1 error ✖ ERROR FP205 undeclared-secret-ref .github/workflows/publish.yml reads secrets.NPM_TOKEN, which is not declared — it is empty when called from 1 caller without `secrets: inherit` ▶ .github/workflows/publish.yml:13:26 11 │ env: 12 │ REGISTRY_URL: ${{ secrets.REGISTRY_URL }} 13 │ NPM_TOKEN: ${{ secrets.NPM_TOKEN }} │ ━━━━━━━━━━━━━━━━━ context └─ .github/workflows/ci.yml:4:11 .github/workflows/ci.yml › jobs.publish passes explicit secrets why Inside a called workflow only declared (or inherited) secrets exist. Reading anything else yields an empty string, so authentication steps fail late or, worse, fall back to anonymous access. fix Declare the secret under `on.workflow_call.secrets` and pass it from every caller, or use `secrets: inherit`. Callers whose `with:` values make the reading job's or step's `if:` false (e.g. an omitted input in `if: contains(inputs.registries, 'docker.io')`) are not counted: the read never runs for them. docs https://ciatlas.github.io/flowpact/docs/rules/fp205 ``` ```text .github/workflows/publish.yml:13:26: property "npm_token" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; github_token: string; registry_url: string} [expression] | 13 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ^~~~~~~~~~~~~~~~~ ``` ```yaml title=".github/workflows/ci.yml" on: push jobs: publish: uses: ./.github/workflows/publish.yml secrets: REGISTRY_URL: ${{ secrets.REGISTRY_URL }} ``` ```yaml title=".github/workflows/publish.yml" on: workflow_call: secrets: REGISTRY_URL: required: true jobs: run: runs-on: ubuntu-latest steps: - run: ./publish.sh env: REGISTRY_URL: ${{ secrets.REGISTRY_URL }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} ``` The difference shows when the repository changes: - **publish.yml declares no secrets at all.** actionlint reports nothing, because it types the `secrets` context only when `on.workflow_call.secrets` declares one. flowpact reports the same `FP205`. - **The only caller uses `secrets: inherit`.** The read works: GitHub's documentation says inherited secrets can be referenced even if they are not declared. actionlint still reports the error above. flowpact reports no error, and an `FP204` info that lists the secrets the inherit feeds. ## Beyond lint [#beyond-lint] Some breaks exist only against something the files do not show: the interface other repositories were written against, or the commit a pull request starts from. **Contracts.** `flowpact check` compares each workflow and action with its committed [contract](https://ciatlas.github.io/flowpact/docs/contracts). For a reusable workflow whose callers are all elsewhere, it is the only check here that notices: after an output was removed and a required input added, actionlint and GitHub's language server reported nothing, and `flowpact check` reported both. ```text ✖ ERROR FP803 breaking-interface-change Breaking change to .github/workflows/deploy.yml: output "deployed-version" was removed — consumers reading it get an empty value ``` **Impact mode.** A pull request titled `fix: tidy the test job` renamed a published workflow's job from `Test` to `Unit tests`: callers' branch protection waits forever for the old check, and release-please ships it as a patch. actionlint and GitHub's language server report nothing. `flowpact impact` fails until the title is `feat!: rename the test job`. See [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode). ```text ✖ ERROR FP810 impact-under-declared Declared patch (the title "fix: tidy the test job"), but the changes require major: check "… / Test" is now "… / Unit tests"; consumers that require the old name wait forever ``` **Trace.** `flowpact trace` follows a value down to where it is used, or with `--up` to where it comes from. actionlint has no equivalent. On the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text $ flowpact trace pipeline.yml:environment .github/workflows/pipeline.yml#inputs.environment:5:7 (input) └── ▶ .github/workflows/build.yml#inputs.environment:5:7 (input) via ${{ inputs.environment }} @ .github/workflows/pipeline.yml:23:24 └── ▶ .github/workflows/package.yml#inputs.environment:5:7 (input) via ${{ inputs.environment }} @ .github/workflows/build.yml:31:24 └── ▶ .github/workflows/publish.yml#inputs.environment:5:7 (input) via ${{ inputs.environment }} @ .github/workflows/package.yml:27:24 └── job setting in jobs.upload › environment .github/workflows/publish.yml:24:22 ${{ inputs.environment }} ``` **In the editor.** flowpact's hover shows where a value comes from and goes, and go to definition, references and rename work across workflow calls. GitHub's language server documents the syntax on hover, and has no definition or references. See [editors](https://ciatlas.github.io/flowpact/docs/editors). ## Where they overlap [#where-they-overlap] These are reported by more than one tool, and actionlint and flowpact report them at the same positions: - actionlint, flowpact and GitHub's extension¹ report a call to a local reusable workflow that leaves out a required input or secret or passes an input it does not declare, a job's `uses:` path to a workflow file that does not exist, a `needs` job output that does not exist or a job that is not under `needs:`, and a matrix key that no combination defines. - actionlint and flowpact also report a literal of the wrong type for a typed input, a missing or misspelled input and an undefined output of a local composite action, and a reusable workflow that reads `matrix.*` without a matrix of its own. - For calls into other repositories, GitHub's extension¹ (when signed in) and flowpact report a required input left out and an input or secret the callee does not declare, and actionlint does for the inputs of popular actions. GitHub's extension reads the callee from GitHub as you edit; flowpact reads the lockfile you commit, so the same check runs in CI and grades a new version before you take it. actionlint reports a missing input in whichever file makes the call; it does not follow a value from one level to the next, as in the `FP107` case above. On shared findings, flowpact adds the chain of calls, why it matters, how to fix it and a "did you mean". Both CLIs produce JSON, SARIF and pull request annotations. GitHub's extension manages runs and logs and completes workflow syntax, which neither CLI does. flowpact's YAML, schema and expression checks (`FP502`–`FP505`) repeat the extension's, so flowpact's VS Code extension [hides them](https://ciatlas.github.io/flowpact/docs/editors#settings) by default in files you open while it runs. ## Measured on the fixture repositories [#measured-on-the-fixture-repositories] The repositories under [`fixtures/`](https://github.com/ciatlas/flowpact/tree/main/fixtures) were linted with both tools (actionlint 1.7.12): | Fixture | actionlint | flowpact | | --- | --- | --- | | `incident-matrix` — one include entry without `config` | **0 findings** | `FP401` naming `{ name: windows }`, the include entry and the receiving input | | `deep-nesting` — a workflow that calls three levels of reusable workflows | 4 findings | the same 4 at identical positions **plus 9**: optional→required forwarding, dropped pass-throughs, unused inputs/outputs/secrets, an output never written by its step, inherited secrets, an undefined env var | | `composite-actions` | 4 findings | the same 4 at identical positions plus unused action inputs/outputs | | `call-permissions` — a release workflow grants less than its publish workflow's job and a Pages deploy in another repository request | **0 findings** | `FP613` twice, naming each job and the scopes it lacks; the remote one from the [lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) | | `clean` | 0 | 0 | ## Use them together [#use-them-together] | Tool | Use it for | Overlap with flowpact | | --- | --- | --- | | [actionlint](https://github.com/rhysd/actionlint) | Each file in depth: expression types, shell scripts (shellcheck), runner labels, cron syntax, script injection, inputs of popular actions | Direct calls to local reusable workflows and local actions, the inputs of popular actions, `needs` outputs, matrix keys no combination defines, and undeclared secrets in a workflow that declares some | | [GitHub Actions extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions) (VS Code) | Writing workflows: completion, documentation on hover, validation (including cron schedules and properties of built-in contexts); runs and logs | Direct calls to local reusable workflows and calls into other repositories (when signed in), missing outputs, `env` variables nothing sets, matrix keys no combination defines; YAML, schema and expression errors (`FP502`–`FP505`) | | [zizmor](https://github.com/zizmorcore/zizmor), ghalint | Security: injection, excessive permissions, pinning | `secrets: inherit`, which zizmor's `secrets-inherit` audit and ghalint's `deny_inherit_secrets` policy flag; flowpact's `FP204` lists the secrets the callee reads | | gh-actions-lockfile, ghasum, actionspack | Pin action and workflow **versions** (SHAs, hashes) | None — they lock *what code runs*, flowpact checks *what data flows* | | GitHub's [`actions.lock`](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock) (`gh actions-lock`) | Pin the commit each action runs, enforced by the runner; not reusable workflow calls | flowpact reads it, so calls to an action it pins are checked at that commit; it records no interfaces | | [CodeQL for GitHub Actions](https://github.blog/security/application-security/how-to-secure-your-github-actions-workflows-with-codeql/) | Security: untrusted data followed through steps, jobs, composite actions and reusable workflows to sinks such as code injection and cache poisoning | Both follow data across files: CodeQL to where it is unsafe, flowpact to where a value arrives empty | | [ravelact](https://github.com/wadackel/ravelact) | Exploring the graph: what an event runs, who calls a workflow, which entry points a change affects; permissions and required secrets down chains of local reusable workflows | Inputs and outputs nothing reads (`FP104`, `FP303`) and a required secret a caller leaves out (`FP201`); it leaves `with:` checks to actionlint and does not evaluate matrices | **Recommendation:** run actionlint and flowpact together, and zizmor for security. flowpact focuses on what crosses file boundaries and matrix combinations. GitHub documents `uses: $/path` for this repository at the running commit (not on GitHub Enterprise Server). actionlint 1.7.12 and GitHub's extension report it as an error, yet accept the invalid `$/path@v1` (the extension in a step only). flowpact resolves `$/`, checks what it points to, and reports the `@ref` form. If you also run actionlint, use the `./` form of an `FP606` fix. # Concepts (https://ciatlas.github.io/flowpact/docs/concepts) flowpact reads your workflows and local actions into a graph of where each value is defined and where it is read, then runs rules over it. These are the terms the rest of the docs use for its parts. ```mermaid flowchart TD accTitle: How values flow between a caller and a reusable workflow B["ci.yml · jobs.test · with: config: ci.json"] I["test.yml · inputs.config"] U["test.yml · a step reads inputs.config"] SO["test.yml · steps.meta.outputs.tag"] JO["test.yml · jobs.build.outputs.tag"] WO["test.yml · on.workflow_call.outputs.tag"] N["ci.yml · needs.test.outputs.tag"] B -->|"binding"| I I --> U SO --> JO JO --> WO WO -->|"back to the caller"| N ``` ## The graph [#the-graph] ### Unit [#unit] A workflow file or a local action (an `action.yml` in the repository). flowpact loads every unit under `.github/workflows` and every local action they use. A workflow or action in another repository becomes a unit too, but only its interface, read from the [remote interfaces lockfile](#remote-interfaces-lockfile): its jobs and steps are not followed. ### Symbol [#symbol] Anything that holds a value, and the jobs: an input, a secret, an output, an env variable, a matrix key. Each has a stable id, the file and its path in it, such as `.github/workflows/test.yml#inputs.config` or `.github/workflows/ci.yml#jobs.build.outputs.version`. Findings name the symbol they are about, an [override](#override) can name it as its `target`, and [`flowpact trace`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-trace) starts from it. ### Binding [#binding] A `key: value` that passes a value on: under `with:` to a reusable workflow's or an action's input, under `secrets:`, or under `env:`. A binding is where a caller's expression meets a callee's input, and where an empty value enters a call. ### Combination [#combination] One job of an expanded matrix: one set of values for its keys, after `include` and `exclude`. flowpact evaluates every binding and condition of the job once per combination of the matrices in your YAML, and a finding names the combinations it affects, such as `{ name: windows }`. A matrix computed at run time (`fromJSON(...)`) is not expanded unless you declare its keys under [`matrixShapes`](https://ciatlas.github.io/flowpact/docs/configuration#matrix-shapes). ### Unknown values [#unknown-values] A value known only when the job runs, such as `github.sha` or another job's output, is *unknown*, and flowpact never guesses it. A matrix key that a combination lacks is not unknown: it is empty, and flowpact follows it into every value it reaches (see [How it works](https://ciatlas.github.io/flowpact/docs/how-it-works#4-expand-matrices--the-part-that-catches-silent-empties)). ### Condition and value [#condition-and-value] An expression in an `if:` is a *condition*: GitHub treats `''`, `0`, `false` and `null` as false and every other value as true, so `if: steps.patch.outputs.file` and `if: steps.patch.outputs.file != ''` decide the same way. Under `env:`, `with:` or `outputs:`, an expression is a *value*, passed on as it is: `a || b` gives the first operand that is true, not `true`, and only a comparison such as `x != ''` gives `true` or `false`. An `if:` with text around its `${{ }}` is a string, which is always true. [FP507](https://ciatlas.github.io/flowpact/docs/rules/fp507) reports a comparison with `''` that a condition does not need, and [FP506](https://ciatlas.github.io/flowpact/docs/rules/fp506) a value that is read as a boolean but can be other text, such as `fromJSON()` of an optional input or an `||` that gives `true` or a file name. ## Findings [#findings] ### Finding [#finding] What a rule reports: a code such as `FP401`, a severity (error, warning or info), the location, the call chain that leads there, the matrix combinations it affects, why it matters and how to fix it. Each [rule](https://ciatlas.github.io/flowpact/docs/rules) has a page. A finding keeps its fingerprint when unrelated lines move. ### Override [#override] A finding you accept, recorded in the [config](https://ciatlas.github.io/flowpact/docs/configuration#overrides) with a reason, and optionally an expiry date and an owner. An accepted finding is listed apart, with the reason; when the date passes it comes back (`FP901`). ### Base config [#base-config] A config with defaults for many repositories, such as an organization's, passed with `--base-config` or the action's `base-config` input. Each repository's own config goes on top of it ([Base config](https://ciatlas.github.io/flowpact/docs/configuration#base-config)). ### Generated file [#generated-file] A workflow or action written by a tool, recognized by a header comment such as `DO NOT EDIT` or `@generated`, by the `.lock.yml` suffix, or by the config ([Generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files)). flowpact still checks how it calls other units and how they call it, but does not report on its internals: the next generation would overwrite a fix. ## Publishing workflows and actions [#publishing-workflows-and-actions] ### Published unit [#published-unit] A unit other repositories can use: every reusable workflow (`on: workflow_call`) but those whose file name starts with `_`, and the action at the repository's root; or, when it is set, the units [`impact.publish`](https://ciatlas.github.io/flowpact/docs/impact-mode#what-is-graded) lists. Renaming one of their jobs or removing one of their outputs breaks callers you cannot see. ### Contract [#contract] A generated file per workflow and local action in `.github/flowpact/contracts/` that records what it accepts, what it returns, what it calls and who calls it. You commit them, and [`flowpact check`](https://ciatlas.github.io/flowpact/docs/contracts) fails when the workflows no longer match: that is **drift**. Each change is graded **breaking**, such as a removed output or a new required input, or not. ### Baseline, required and declared impact [#baseline-required-and-declared-impact] [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) compares a pull request with its **baseline**, usually the base branch. From the changes to published units it computes the **required** impact (major, minor, patch or none), and compares it with the **declared** one, by default from the Conventional Commits title. It fails when the declared impact is less. ## Other repositories [#other-repositories] ### Remote reference [#remote-reference] A `uses:` of a workflow or action in another repository: `octo/ship/.github/workflows/deploy.yml@v1`, `octo/setup@v2`. Its `@ref` is a tag, a branch or a commit SHA. ### Remote interfaces lockfile [#remote-interfaces-lockfile] `.github/flowpact/remotes.lock.yaml`, written by [`flowpact remotes update`](https://ciatlas.github.io/flowpact/docs/remote-interfaces): the inputs, secrets and outputs of each remote reference, at the commit it resolved to. Runs read only this committed file, so they check remote calls without the network. ### actions.lock [#actionslock] GitHub's own lockfile, `.github/workflows/actions.lock`, which pins the commit each remote action runs; GitHub does not lock reusable workflow calls. flowpact reads it, to check an action at the commit that runs (see [GitHub's actions.lock](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock)). ### Version change and verdict [#version-change-and-verdict] A remote reference that moves to another commit, by a moved tag or a bump to another version. flowpact grades it against every call of the reference, and each call gets a **verdict**: it *breaks* (a check fails with the new interface that passed with the old one), it is *not fully checked* (part of the change is beyond the checks), or it *fits* (see [When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes)). ### Sources cache [#sources-cache] Where `flowpact remotes update` and `remotes download` keep the remote workflow files and `action.yml`s they read, so the editor can open them ([Sources for the editor](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor)). # Configuration (https://ciatlas.github.io/flowpact/docs/configuration) flowpact works without configuration. To change behaviour, create `.github/flowpact/flowpact.config.yml` (or pass `--config `): ```yaml title=".github/flowpact/flowpact.config.yml" # yaml-language-server: $schema=https://ciatlas.github.io/flowpact/schemas/config/v1.json version: 1 # owner/repo of this repository, so `uses: owner/repo/.github/workflows/x.yml@ref` resolves locally. # Detected from GITHUB_REPOSITORY or .git/config when omitted. repository: acme/platform rules: # by code or by name; values: error | warning | info | off FP104: error secrets-inherit: off needs-without-data: info # opt-in rule limits: nestingDepth: 10 # FP602: workflows in one call chain, counting the top-level workflow maxInputs: 30 # FP605: workflow_call inputs before suggesting to group them ignore: - .github/workflows/experimental/ # path prefix - .github/workflows/legacy-*.yml # glob (* within a segment, ** across) overrides: - rule: unused-input target: .github/workflows/pipeline.yml#inputs.legacy-flag reason: Read by the external release dispatcher; remove after the migration (JIRA-123) expires: 2026-12-31 owner: '@platform-team' matrixShapes: .github/workflows/tests.yml#e2e: keys: [os, browser] generated: include: [.github/workflows/rendered-*.yml] # generated, but without a header comment exclude: [.github/workflows/docs.yml] # written by hand, despite its header plugins: - ./ci/flowpact-rules.mjs ``` The config is validated strictly: unknown keys and invalid values are reported with their path (exit code `2`). An unknown code with the built-in prefix (`FP` and a digit, such as `FP999`) or a typo of a loaded rule is an error too, with a suggestion; other unknown rule names are [ignored with a warning](#rules-that-are-not-loaded), since they may belong to a plugin that is not loaded. ## Editor autocomplete [#editor-autocomplete] The schema is published at [`/schemas/config/v1.json`](https://ciatlas.github.io/flowpact/schemas/config/v1.json). The comment on the first line of the example enables completion, hover docs and validation in editors that use the YAML language server (VS Code with the Red Hat YAML extension, JetBrains IDEs, Neovim): ```yaml # yaml-language-server: $schema=https://ciatlas.github.io/flowpact/schemas/config/v1.json ``` ## Overrides [#overrides] `rules:` and `ignore:` change a rule or a path everywhere. An **override** accepts one specific finding, with a reason that stays next to it in the repository (to accept it on its line instead, use an [ignore comment](#ignore-comments)): ```yaml overrides: - rule: unused-input # code (FP104) or name target: .github/workflows/pipeline.yml#inputs.legacy-flag # the symbol the finding is about reason: Read by the external release dispatcher; remove after the migration (JIRA-123) expires: 2026-12-31 # optional, YYYY-MM-DD owner: '@platform-team' # optional - rule: remote-unverified file: .github/workflows/release.yml # every finding of this rule in this file reason: Calls into acme/shared-workflows are verified in that repository - rule: FP105 target: '**#inputs.app-id' # this input, in every workflow and action reason: Without app credentials the steps use github.token instead ``` | Key | Required | Description | | --- | --- | --- | | `rule` | yes | Rule code or name. See [Rules that are not loaded](#rules-that-are-not-loaded) for names no loaded rule has. | | `target` | `target` or `file` | The finding's symbol id. `*` matches within a path segment, `**` across segments, e.g. `.github/workflows/*.yml#inputs.legacy-*`. | | `file` | `target` or `file` | The file the finding is reported in: a path, a path prefix or a glob. | | `reason` | yes | Why the finding is accepted (at least 10 characters). | | `expires` | no | `YYYY-MM-DD` (a UTC date). The override is honored through the end of that day in UTC; from the next day the finding is reported again. | | `owner` | no | Who owns the exception, shown in expiry messages. | Either `target` or `file` is required, so an override cannot silence a rule everywhere (use `rules:` for that). When both are set, both must match. **Finding the symbol.** Every finding has a `symbol` in JSON output — copy it into `target`: ```sh flowpact lint --format json | jq -r '.findings[] | "\(.code) \(.symbol)"' ``` **What happens to accepted findings.** They are removed from the report and from the error/warning/info counts, so they do not fail the build. They are not lost: JSON output lists them under `suppressed`, each with the override that accepted it (`index`, `reason`, `expires`, `owner`), and `summary.suppressed` counts them. **Keeping overrides honest.** Three rules check the overrides themselves (they run after overrides are applied, so they cannot be overridden): | Code | Severity | Reported when | | --- | --- | --- | | [`FP901`](https://ciatlas.github.io/flowpact/docs/rules/fp901) `override-expired` | error | The `expires` date has passed. The findings it accepted are reported again. | | [`FP902`](https://ciatlas.github.io/flowpact/docs/rules/fp902) `override-unused` | warning | The override matches no finding — the problem was fixed, or the target is misspelled. | | [`FP903`](https://ciatlas.github.io/flowpact/docs/rules/fp903) `override-expiring-soon` | info | It expires within 14 days and still matches findings. | Overrides apply to every rule, including the [contract rules](https://ciatlas.github.io/flowpact/docs/contracts) — but an intended interface change is better recorded by regenerating the contracts than by overriding `FP803`. ## Ignore comments [#ignore-comments] An **ignore comment** accepts a rule's findings on one line of a workflow or action file, next to the code they are about: ```yaml title=".github/workflows/release.yml" jobs: publish: runs-on: ubuntu-latest steps: - run: ./scripts/setup-env.sh # exports DEPLOY_URL through $GITHUB_ENV # flowpact: ignore[FP501] set by scripts/setup-env.sh - run: curl --fail "${{ env.DEPLOY_URL }}/health" notify: needs: publish uses: acme/shared/.github/workflows/notify.yml@3f1c2a9b7d4e6f8a0b1c2d3e4f5a6b7c8d9e0f1a # v1.2.0 # flowpact: ignore[remote-unverified] checked in acme/shared ``` - `ignore[…]` names one rule or several, by code or by name, separated by commas: `ignore[FP501, unused-input]`. - Text after the `]` is the reason. It is optional (a leading `--` is dropped), and the reports show it with the finding. - The comment accepts the findings reported on its own line: the line of `file:line:column`, where the editor underlines them. Alone on its line, it accepts those on the next line of YAML, past blank lines and other comments. - On the line of a block scalar (`run: |`), it accepts the findings in the scalar's text. After a scalar over several lines, it accepts those on all its lines. A `#` inside a string or a `run:` script is not a YAML comment, so a directive there does nothing. - It can follow other comments on the line, such as the version of a pinned action or workflow. Keep the version first (`@ # v1.2.0 # flowpact: ignore[…]`): Dependabot and Renovate read it right after the SHA. An ignore comment has no expiry and no owner. For an exception that should come back on a date, use an [override](#overrides). Findings outside workflow and action files (a lockfile, a contract) are accepted with an override too. **What happens to accepted findings.** The same as with overrides. They are removed from the report and from the counts, and listed apart: JSON output lists them under `ignoredByComment`, each with the `comment` that accepted it (`loc`, and `reason` when it has one), and `summary.ignoredByComment` counts them. The Markdown summary lists them with the findings overrides accepted, and SARIF leaves both out. A finding that an override and a comment both accept is listed under the override, and neither counts as unused. **Keeping ignore comments honest.** Two rules check them once they are applied (no comment can ignore them): | Code | Severity | Reported when | | --- | --- | --- | | [`FP904`](https://ciatlas.github.io/flowpact/docs/rules/fp904) `ignore-comment-invalid` | warning | The comment names an unknown rule (a typo gets a suggestion) or one no comment can ignore (`FP9xx`, and impact mode's `FP810`–`FP814`, which grade the pull request itself), or it is not written as `ignore[]`. | | [`FP905`](https://ciatlas.github.io/flowpact/docs/rules/fp905) `ignore-comment-unused` | warning | A rule it names reports nothing on the line it accepts: the problem was fixed, or the comment is on another line than the finding. | A rule that is turned off, or left out by `--only`, does not make its comments unused. A comment that names a rule of a plugin this run does not load is [ignored with a warning](#rules-that-are-not-loaded), like a config entry for it. In the [editor](https://ciatlas.github.io/flowpact/docs/editors#quick-fixes), every finding in a workflow or action offers **Ignore FP… on this line with a comment**, which adds the comment on a line of its own above the finding's, or adds the rule to a comment that is there already. ## Matrix shapes [#matrix-shapes] A matrix computed at runtime (`matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}`) cannot be expanded statically, so by default flowpact reports it as unverifiable (`FP403`) and does not check its `matrix.*` reads. If you know which keys the generated matrix has, declare them: ```yaml matrixShapes: # # .github/workflows/tests.yml#e2e: keys: [os, browser, shard] ``` flowpact then checks every `matrix.*` read in that job against the declared keys and reports unknown ones as `FP404` (for example `matrix.brower`); `FP403` is no longer reported for the job. The values of the keys stay unknown, so per-combination checks (`FP401`, `FP402`) do not apply. The declaration is used only for jobs whose matrix (or `include`) is actually computed at runtime. ## Generated files [#generated-files] Some workflows are written by tools rather than people: [GitHub Agentic Workflows](https://github.com/github/gh-aw) compiles `*.md` files into `*.lock.yml` workflows, and some repositories render their workflows from templates. Editing such a file does not fix anything — the next generation overwrites it — so flowpact still checks how it calls other units and how other units call it, but does not report on its internals. A workflow or action file counts as generated when its name ends in `.lock.yml`, or when the comment block at the top of the file (within its first 10 lines) says so in a generator's words: - `DO NOT EDIT` or `DO NOT MODIFY` in capitals (`DO NOT EDIT.`, `DO NOT EDIT MANUALLY`), or `do not edit this file`, `do not edit manually`, `do not edit by hand`; - `@generated`; - `This file was generated`, `This workflow is automatically generated`, `This is an auto-generated file`; - a comment that starts with `Generated by `, `Generated from `, `Code generated by ` or `Auto-generated file`. ```yaml title=".github/workflows/triage.lock.yml" # This file was automatically generated by gh-aw. DO NOT EDIT. name: Triage ``` A comment that only talks about generated things does not count: `# Generated docs are published by this workflow`, `# Builds the autogenerated API client` or `# Please do not edit the deploy keys` leave the file hand-written. `flowpact lint -v` lists the files it treats as generated, and why. When it guesses wrong, say so in the config; paths and globs match the file (`.github/actions/x/action.yml`) or, for an action, its directory: ```yaml generated: include: # generated, though nothing in the file says so - .github/workflows/rendered-*.yml exclude: # written by hand, whatever the header or name says - .github/workflows/docs.yml ``` A file listed under `exclude` is never treated as generated, even when it also matches `include`. In a generated file, these rules are not reported — dead declarations, style advice and ignore comments, whose only fix is an edit to the file: | Code | Name | | --- | --- | | [`FP104`](https://ciatlas.github.io/flowpact/docs/rules/fp104) | `unused-input` | | [`FP105`](https://ciatlas.github.io/flowpact/docs/rules/fp105) | `optional-input-no-default-in-condition` | | [`FP203`](https://ciatlas.github.io/flowpact/docs/rules/fp203) | `unused-secret` | | [`FP204`](https://ciatlas.github.io/flowpact/docs/rules/fp204) | `secrets-inherit` | | [`FP303`](https://ciatlas.github.io/flowpact/docs/rules/fp303) | `unused-output` | | [`FP304`](https://ciatlas.github.io/flowpact/docs/rules/fp304) | `step-output-never-written` | | [`FP507`](https://ciatlas.github.io/flowpact/docs/rules/fp507) | `redundant-empty-comparison` | | [`FP604`](https://ciatlas.github.io/flowpact/docs/rules/fp604) | `needs-without-data` | | [`FP605`](https://ciatlas.github.io/flowpact/docs/rules/fp605) | `large-interface` | | [`FP607`](https://ciatlas.github.io/flowpact/docs/rules/fp607) | `unreferenced-reusable-workflow` | | [`FP904`](https://ciatlas.github.io/flowpact/docs/rules/fp904) | `ignore-comment-invalid` | | [`FP905`](https://ciatlas.github.io/flowpact/docs/rules/fp905) | `ignore-comment-unused` | Every other rule still applies: invalid YAML or expressions, schema errors, and every check of a call between units — a generated workflow that calls one of your reusable workflows without a required input (`FP101`), or a hand-written workflow that passes an unknown input to a generated one (`FP102`). Values that a hand-written unit receives from or hands to a generated one are traced as usual. To drop every finding in generated files, ignore them: ```yaml ignore: - .github/workflows/*.lock.yml ``` The report counts the findings it leaves out (`summary.skippedInGenerated` in `--format json`, and a line under the summary). An override written for one of them, from before flowpact skipped generated files, now matches nothing: [`FP902`](https://ciatlas.github.io/flowpact/docs/rules/fp902) says so, and the override can be deleted. ## Plugins [#plugins] Organization-specific rules can be loaded from JavaScript modules: ```yaml plugins: - ./ci/flowpact-rules.mjs ``` Paths are relative to the repository root. A module default-exports a rule or an array of rules (or exports them as `rules`). Plugin rules need their own code prefix and a `docsUrl`; see [Custom rules](https://ciatlas.github.io/flowpact/docs/custom-rules) for the rule format. Plugins are loaded by `flowpact lint`, `flowpact check` and `flowpact generate`, and by the [GitHub Action](https://ciatlas.github.io/flowpact/docs/action). Loading a plugin executes it, with the permissions of whoever runs flowpact. Only run flowpact with plugins on code you trust. The GitHub Action skips plugins on `pull_request_target` and `workflow_run` events unless its `plugins` input is set to `true`; the CLI skips them with `--no-plugins`. ### Rules that are not loaded [#rules-that-are-not-loaded] `rules:` and `overrides:` entries for a rule that is not loaded in a run are ignored for that run and listed in a warning. That happens when plugins are skipped, or when a repository configures an [organization rule](https://ciatlas.github.io/flowpact/docs/integrating#organization-rules) that only its organization's wrapper loads: the entry takes effect in the wrapper, and plain `flowpact lint` or the editor ignore it. What is still a config error, so a typo is not hidden: - a code with the built-in prefix (`FP999`, `FP-101`), or a built-in code with a character replaced (`FPl01`); - a code one edit from a loaded code with the same prefix (`ACME610` beside a loaded `ACME601`); - another spelling of a loaded rule's name (`unusedInput`), or one at most two edits from it (`unused-inptu`). A code with another prefix (`AC201`, `DP201`) or a name that adds a word to a loaded one (`no-secrets-inherit`) belongs to a plugin and is ignored with the warning. The rules an [ignore comment](#ignore-comments) names are sorted the same way, except that a typo is reported as [`FP904`](https://ciatlas.github.io/flowpact/docs/rules/fp904) rather than as a config error. ## Base config [#base-config] A base config holds defaults for many repositories, such as an organization's. It is passed with the CLI's `--base-config ` or the action's `base-config` input, usually by an organization's [copy of the action](https://ciatlas.github.io/flowpact/docs/integrating#copy-the-action) or wrapper, and each repository's own config goes on top of it: ```yaml title="acme.base.yml (in the wrapper)" rules: FP105: error # stricter than the default everywhere needs-without-data: info # an opt-in rule, on for everyone acme-deploy-env: error # an organization rule, loaded with --plugin ignore: - .github/workflows/generated/ impact: declaredBy: labels ``` ```yaml title=".github/flowpact/flowpact.config.yml (in one repository)" rules: FP105: warning # this repository wins ignore: - .github/workflows/legacy-*.yml ``` ```sh flowpact lint --base-config acme.base.yml ``` | Key | In a base config | Combined with the repository's | | --- | --- | --- | | `rules`, `limits`, `impact` | allowed | key by key; the repository's value wins (`impact.types` and `impact.labels` entry by entry) | | `ignore`, `generated` | allowed | both lists apply | | `repository`, `overrides`, `matrixShapes`, `impact.publish` | config error | they name files of one repository | | `plugins` | config error | plugins run code; organization rules load with the action's `plugin` input or [`--plugin`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-lint) | The repository's config still works on its own: run without the base config, as locally and in the editor, flowpact uses the repository's config and the defaults. The base config's path is relative to the working directory (`--base-config`) or to the action's own directory (the `base-config` input), and the banner shows it (`config .github/flowpact/flowpact.config.yml · base acme.base.yml`). A repository's config cannot point at a base config itself; see [why](https://ciatlas.github.io/flowpact/docs/integrating#why-not-extends). ## Reference [#reference] | Key | Type | Default | Description | | --- | --- | --- | --- | | `$schema` | string | — | JSON Schema reference for editors (the `# yaml-language-server` comment works too). | | `version` | `1` | `1` | Config schema version. | | `repository` | `owner/repo` | detected | Lets same-repository `owner/repo/...@ref` references resolve locally. | | `rules` | map of code or name → `error` \| `warning` \| `info` \| `off` | `{}` | Severity per rule. | | `limits.nestingDepth` | positive integer | `10` | Maximum workflows in one call chain (FP602). | | `limits.maxInputs` | positive integer | `30` | `workflow_call` inputs before FP605. | | `ignore` | list of paths or globs | `[]` | Findings in matching files are suppressed, and [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode#only-some-units) does not grade the published units in them when the baseline's `ignore` matches them too, so a pull request's own edit cannot take a unit out of its check. | | `overrides` | list of `{rule, target?, file?, reason, expires?, owner?}` | `[]` | Accepted findings, each with a reason and an optional expiry date ([details](#overrides)). | | `matrixShapes` | map of `#` → `{ keys: [...] }` | `{}` | Declared keys of runtime-computed matrices ([details](#matrix-shapes)). | | `generated.include` | list of paths or globs | `[]` | Workflows and actions that are generated, even without a marker ([details](#generated-files)). | | `generated.exclude` | list of paths or globs | `[]` | Workflows and actions written by hand, even with a marker or a `.lock.yml` name; wins over `include`. | | `impact.publish` | list of paths or globs | reusable workflows (except `_`-prefixed files) and the root `action.yml` | Units other repositories use ([impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode)). Their outputs are not reported as unused ([`FP303`](https://ciatlas.github.io/flowpact/docs/rules/fp303)); list actions in subdirectories (`owner/repo/restore@v1`) here too. | | `impact.declaredBy` | `explicit` \| `title` \| `labels` | `explicit` when given, else `title` | The authoritative source of the declared impact. | | `impact.labels` | `{ major, minor, patch, none }` | `semver:*` | Label names that declare each level. | | `impact.types` | map of type → level | `feat: minor`, `fix` / `perf: patch` | Conventional Commits types; others declare `none`, `!` declares `major`. | | `impact.uncertain` | `warn` \| `fail` | `warn` | Whether changes flowpact cannot fully resolve count towards the required impact. | | `plugins` | list of paths | `[]` | JavaScript modules exporting extra rules ([details](#plugins)). | # Contracts (https://ciatlas.github.io/flowpact/docs/contracts) Remove an output from a reusable workflow or action and every caller that reads it gets an empty value, including callers in other repositories that flowpact cannot see. A **contract** makes such a change visible in review: it records what a workflow or local action accepts, what it returns, what it calls and who calls it. `flowpact generate` writes one per workflow and local action into `.github/flowpact/`, you commit them, and `flowpact check` fails when the workflows no longer match, marking the changes that break callers. To also check the release a pull request declares, see [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode). Think of it as a lockfile for interfaces: `package-lock.json` makes dependency changes visible in review; contracts do the same for the inputs, secrets and outputs that flow between workflows. ## Generated only [#generated-only] Contracts are never written by hand: - `flowpact generate` produces them from the workflows. Output is **deterministic**: keys are sorted, and there are no hashes, timestamps or tool versions in the file. Comments, key order and YAML quoting in your workflows do not change a contract; a change to the interface or the wiring does. (`with:` values are recorded as written, so editing an expression shows up too.) - A contract describes what *is*, so it can never disagree with the workflows after you regenerate. - Decisions about findings live in the [config](https://ciatlas.github.io/flowpact/docs/configuration#overrides), not in contracts. Each file starts with a header that says so: ```yaml # Generated by flowpact — do not edit by hand. Run `flowpact generate` to update. # Docs: https://ciatlas.github.io/flowpact/docs/contracts ``` ## What is in a contract [#what-is-in-a-contract] This is the locked (committed) contract for a reusable deploy workflow in the [`contracts-drift` fixture](https://github.com/ciatlas/flowpact/tree/main/fixtures/contracts-drift). It still lists the `deployed-version` output that the fixture's workflow has since removed — exactly the drift `flowpact check` reports as FP803; `flowpact generate` would drop it: ```yaml title=".github/flowpact/contracts/workflows/deploy.contract.yaml" # Generated by flowpact — do not edit by hand. Run `flowpact generate` to update. # Docs: https://ciatlas.github.io/flowpact/docs/contracts $schema: https://ciatlas.github.io/flowpact/schemas/contract/v1.json version: 1 kind: workflow path: .github/workflows/deploy.yml name: Deploy triggers: - workflow_call interface: inputs: dry-run: type: boolean required: false default: false environment: type: string required: true legacy-flag: type: string required: false default: '' description: Read by the old release dispatcher only version: type: string required: true secrets: deploy-token: required: true outputs: deployed-version: description: The version that was deployed value: ${{ jobs.deploy.outputs.version }} url: description: Where the release was deployed value: ${{ jobs.deploy.outputs.url }} uses: - job: deploy step: '#2' uses: .github/actions/notify with: message: Deployed ${{ inputs.version }} to ${{ inputs.environment }} consumers: - from: .github/workflows/release.yml job: deploy passes: - dry-run - environment - version reads: - url ``` | Section | Contents | | --- | --- | | `kind`, `path`, `name` | `workflow` or `action`, the repository path and the display name. | | `triggers` | Workflow events, sorted (workflows only). | | `interface.inputs` | Every `workflow_call` input (or action input) with `type`, `required`, `default`, `description` and choice `options`. | | `interface.dispatchInputs` | `workflow_dispatch` inputs, in the same form (workflows only). | | `interface.secrets` | `workflow_call` secrets and whether they are required. | | `interface.outputs` | `workflow_call` (or action) outputs with their description and value expression. | | `calls` | Reusable workflows this workflow calls, per job: what it passes in `with:` and `secrets:` (or `inherit`), `needs`, and the matrix shape (`combinations`, `keys`, `exact`). | | `uses` | Local actions used by steps (`step` is the step `id`, or `#n` for the n-th step). | | `consumers` | Who calls this workflow or uses this action, which inputs they pass and which outputs they read. | A caller's contract shows the wiring from the other side, including the matrix it fans out over: ```yaml title=".github/flowpact/contracts/workflows/tests.contract.yaml (excerpt)" calls: - job: run uses: .github/workflows/run-suite.yml with: config: ${{ matrix.config }} suite: ${{ inputs.suite }} variant: ${{ matrix.name }} matrix: combinations: 3 keys: - config - name exact: true ``` The schema is published at [`/schemas/contract/v1.json`](https://ciatlas.github.io/flowpact/schemas/contract/v1.json). ### File names [#file-names] | Unit | Contract file | | --- | --- | | `.github/workflows/ci.yml` | `.github/flowpact/contracts/workflows/ci.contract.yaml` | | `.github/actions/setup` | `.github/flowpact/contracts/actions/setup.contract.yaml` | | `.github/actions/node/setup` | `.github/flowpact/contracts/actions/node__setup.contract.yaml` | | `tools/build` (any other local action) | `.github/flowpact/contracts/actions/tools__build.contract.yaml` | Names that would collide (`ci.yml` and `ci.yaml`) get a distinguishing suffix, and an existing contract keeps its file name. flowpact reads contracts named `.contract.yaml` and `.contract.yml` alike. It writes new ones as `.contract.yaml`, except in a repository whose contracts are all `.contract.yml` (as written before 0.18), where new ones match them. To move to `.contract.yaml`, rename the files: each contract names its unit, so a renamed contract is still that unit's. ## Workflow [#workflow] ```mermaid sequenceDiagram accTitle: A contract through a pull request participant Dev as You participant Repo as Repository participant CI as flowpact check in CI Dev->>Repo: generate, commit the contracts Dev->>Repo: a pull request removes an output Repo->>CI: pull_request CI-->>Dev: FP803, and a patch Dev->>Repo: generate again, commit CI-->>Dev: the diff in review, check passes ``` ### Generate [#generate] ```sh flowpact generate ``` Writes a contract for every workflow and local action, updates the ones that changed and deletes contracts whose workflow or action no longer exists. It prints what it did, with the semantic changes per file; breaking ones are marked. Preview first with `--dry-run`, which prints the same table plus a colored diff and writes nothing: ### Commit [#commit] Commit `.github/flowpact/` with the workflows. From now on, every pull request that changes an interface also changes a contract, and reviewers see the change as a small YAML diff. ### Check in CI [#check-in-ci] ```sh flowpact check ``` Runs every lint rule **and** compares the contracts on disk with the ones the current workflows produce. Contract findings are errors by default, so the job fails until the contracts are regenerated (see [CI usage](https://ciatlas.github.io/flowpact/docs/ci)). ### Regenerate on intentional changes [#regenerate-on-intentional-changes] When the change is intended, run `flowpact generate` again and commit the result. In the editor, the quick fix **Regenerate the contracts** on a contract finding does the same ([Quick fixes](https://ciatlas.github.io/flowpact/docs/editors#quick-fixes)). For a breaking change, first update the callers listed under `consumers` — including those in other repositories, which flowpact cannot see. ## Breaking and non-breaking changes [#breaking-and-non-breaking-changes] A change to an interface is a change to its contract, so reviewers see it as a diff. Removing an output of a reusable workflow: ```diff title=".github/flowpact/contracts/workflows/deploy.contract.yml" outputs: - deployed-version: - description: The version that was deployed - value: ${{ jobs.deploy.outputs.version }} url: description: Where the release was deployed value: ${{ jobs.deploy.outputs.url }} ``` `flowpact generate` and `flowpact check` compare the committed contract with the current one field by field: | Change | Breaking | | --- | --- | | Input removed | yes | | Input type changed (`string` → `number`, …) | yes | | Input becomes required, or is added as required — for a `workflow_call` input even with a default (GitHub requires every caller to pass it); for action inputs only without one | yes | | Choice option removed | yes | | Secret removed, becomes required, or added as required | yes | | Output removed | yes | | `workflow_call` trigger removed | yes | | `workflow_dispatch` input removed, type changed, choice option removed, or required without a default (added or changed) | yes | | Optional input added (or, for actions and `workflow_dispatch`, a required input with a default) | no | | Input becomes optional, default or description changed, choice option added | no | | Secret becomes optional, optional secret added | no | | Output added, or its value or description changed | no | | Other triggers or the name changed | no | | What this workflow passes to the workflows and actions it calls (`calls`, `uses`) | no | | Consumers added or removed, or what they pass or read | no | Breaking means: a caller written against the committed contract can now fail (unknown or missing input or secret) or silently read an empty value. ## Codes [#codes] | Code | Name | Reported when | | --- | --- | --- | | [`FP801`](https://ciatlas.github.io/flowpact/docs/rules/fp801) | `contract-missing` | A workflow or local action has no contract. | | [`FP802`](https://ciatlas.github.io/flowpact/docs/rules/fp802) | `contract-outdated` | The contract differs from the workflow by non-breaking changes. | | [`FP803`](https://ciatlas.github.io/flowpact/docs/rules/fp803) | `breaking-interface-change` | A breaking change, one finding per change, with the known consumers as context. | | [`FP804`](https://ciatlas.github.io/flowpact/docs/rules/fp804) | `orphan-contract` | A contract exists for a workflow or action that no longer exists. | | [`FP805`](https://ciatlas.github.io/flowpact/docs/rules/fp805) | `contract-invalid` | A contract file is not valid YAML or does not match the schema. | All five are errors by default and are only reported by `flowpact check` (`flowpact lint` does not read contracts). Like any rule, their severity can be changed under [`rules:`](https://ciatlas.github.io/flowpact/docs/configuration) in the config. ## Merge conflicts [#merge-conflicts] Two branches that both change an interface will conflict in the contract. Do not merge contract files by hand: resolve the conflicts in the workflow files, then regenerate. `flowpact generate` overwrites the conflicted contracts, conflict markers and all. ```sh flowpact generate git add .github/flowpact/ ``` A contract that was hand-edited or merged into invalid YAML is reported by `flowpact check` as `FP805`. ## Without the CLI: download the regenerated contracts [#without-the-cli-download-the-regenerated-contracts] Not everyone who edits a workflow has Node.js or flowpact installed. CI can regenerate the contracts for them: - The [flowpact GitHub Action](https://ciatlas.github.io/flowpact/docs/action) uploads the regenerated contracts and a `git apply`-able patch as an artifact when it finds drift. - With the CLI alone, `flowpact check --patch flowpact-contracts.patch` writes the patch when contracts drifted; upload it with `actions/upload-artifact` (see [CI usage](https://ciatlas.github.io/flowpact/docs/ci)). Then, from the repository root: ```sh git apply --index flowpact-contracts.patch # --index also stages contracts the patch creates git commit -m "Update workflow contracts" ``` `flowpact generate --patch ` writes the same patch locally, and `flowpact generate --out ` writes the complete set of contracts under another directory (without deleting anything) — useful to inspect them side by side. # Custom rules (https://ciatlas.github.io/flowpact/docs/custom-rules) Every rule — built-in or not — is a single definition. That definition is the source for the runtime message, the why/fix text and docs URL printed with each finding, and (for built-in rules) `flowpact explain` and the generated rule pages on this site. ```js title="ci/flowpact-rules.mjs" /** Jobs that deploy to production must depend on the approval job. */ const prodNeedsApproval = { code: 'ACME601', name: 'prod-deploy-needs-approval', category: 'structure', defaultSeverity: 'error', docsUrl: 'https://wiki.acme.dev/ci/ACME601', docs: { summary: 'Jobs that deploy to production must depend on the approval job.', why: 'Production deploys without the approval gate bypass change management.', fix: 'Add `approve` to the job’s `needs:`.', }, check(ctx) { for (const wf of ctx.index.project.workflows.values()) { for (const job of Object.values(wf.jobs)) { const deploysProd = job.with.environment?.value === 'production'; if (deploysProd && !job.needs.some((n) => n.id === 'approve')) { ctx.report({ message: `jobs.${job.id} deploys to production without needing "approve"`, loc: job.loc, symbol: `${wf.path}#jobs.${job.id}`, }); } } } }, }; export default [prodNeedsApproval]; ``` A rule is a plain object, so a plugin needs no imports. Built-in rules are written the same way in TypeScript, wrapped in `defineRule(...)` for type checking. A plugin written in TypeScript gets the `RuleDefinition` type from the flowpact package (see [TypeScript](https://ciatlas.github.io/flowpact/docs/api#typescript) in the API). Besides `message`, `loc` and `symbol`, `ctx.report` takes `fix` (advice for this finding instead of the rule's) and `severity`, which reports one finding below the rule's severity. It can only lower it: a finding never exceeds the severity the rule is configured with. Two optional fields shape where and how a rule speaks: - `generatedFiles: 'skip'` drops the rule's findings located in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files) (gh-aw `*.lock.yml`, a `DO NOT EDIT` header). Use it for rules about a file's own internals, such as dead declarations or style; the default, `'report'`, suits checks of calls between units. - `docs.scope` describes what the rule deliberately leaves out. It appears in `flowpact explain` (and on the built-in rule pages), but not with each finding. ## Codes [#codes] Codes have the form ``: | Digit | Category | Digit | Category | | --- | --- | --- | --- | | `1` | inputs | `6` | structure | | `2` | secrets | `7` | hygiene | | `3` | outputs | `8` | contracts | | `4` | matrix | `9` | config | | `5` | expressions | | | The registry enforces the format and that the digit matches the declared category, rejects duplicate codes and names, reserves the `FP` prefix for built-in rules, and requires third-party rules to bring their own `docsUrl`. ## What a rule can use [#what-a-rule-can-use] `ctx.index` and the types it leads to are flowpact's own model of the workflows, and a minor release can change them. The rule object a plugin exports is covered: see [Stability](https://ciatlas.github.io/flowpact/docs/stability). `ctx.index` is the [data-flow graph](https://ciatlas.github.io/flowpact/docs/how-it-works): - `ctx.index.units()`, `project.workflows`, `project.actions` — the IR with exact locations; - `callSites`, `callersOf(path)`, `actionUses`, `usersOf(path)` — who calls whom; - `usagesOf(symbol)` — every place a symbol is read, with the location of the reference and where the value flows next; a read of a whole object or through a computed key or `*` (`toJSON(inputs)`, `matrix[inputs.key]`, `needs.build.outputs`, `steps.*.outputs`) is a usage of each member, marked `whole`: it names none of them. In a workflow that can be dispatched, a read through `github` (`github.event.inputs.`, `toJSON(github)`) is a usage of its `workflow_dispatch` inputs, except in its own input defaults and `workflow_call` outputs, which GitHub evaluates only when it is called. In one that can also be called, `github` is then the caller's, so such a usage never takes in what a caller passes in `with:`. A whole or computed `secrets` (`toJSON(secrets)`, `secrets[inputs.name]`) is a usage of each secret the workflow declares, reads by name or is passed by name, of its `GITHUB_TOKEN`, and, when callers hand it every secret through `secrets: inherit`, of each secret they declare, read by name or are passed by name; - `ctx.matrix(unit, job)` — the expanded matrix (combinations, keys, exactness); - `ctx.config` — the resolved configuration; - `ctx.contracts` — the contract comparison (only in `flowpact check`). `ctx.report()` takes the `message`, `loc` and optional `symbol`, `related` locations, `combos` and an instance-specific `fix`. A milder variant of the problem can pass `severity: 'warning'` or `'info'`: it lowers that finding below the rule's severity, never raises it, and a lower severity set in the config still wins. ## Loading plugins [#loading-plugins] List the module under `plugins:` in the [config](https://ciatlas.github.io/flowpact/docs/configuration#plugins): ```yaml title=".github/flowpact/flowpact.config.yml" plugins: - ./ci/flowpact-rules.mjs rules: prod-deploy-needs-approval: warning # plugin rules are configured like built-in ones ``` - Paths are relative to the repository root; the module is loaded with Node's `import()`, so it must be JavaScript (`.mjs`, or `.js` in an ESM package). - It default-exports a rule or an array of rules, or exports them as `rules`. - The CLI also loads plugins given with `--plugin ` (relative to the working directory, repeatable), and the action those in its `plugin` input (relative to the action's directory), such as organization rules shipped with a [copy of the action](https://ciatlas.github.io/flowpact/docs/integrating#organization-rules). `--no-plugins` and the action's `plugins` input skip the plugins the config lists, but not those. - `flowpact lint`, `flowpact check` and the [GitHub Action](https://ciatlas.github.io/flowpact/docs/action) run plugin rules next to the built-in ones, so they can be configured under `rules:`, accepted with [overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides) and selected with `--only`. - A plugin that is missing, fails to load, exports no rules, or registers an invalid rule (wrong code format, `FP` prefix, no `docsUrl`, duplicate code or name) stops the run with exit code `2`. Each finding links to the rule's `docsUrl`, so point it at your own documentation. # Editors (https://ciatlas.github.io/flowpact/docs/editors) flowpact ships a language server, so the analysis runs while you edit instead of only in CI. In VS Code, install **flowpact** from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=flowpact.vscode-flowpact); in VSCodium, Cursor, Windsurf and other editors built on VS Code, from [Open VSX](https://open-vsx.org/extension/flowpact/vscode-flowpact). The extension bundles the server. Other editors start it with [`flowpact lsp`](#other-editors). Where neither registry is reachable, install the `.vsix` from a GitHub release: see [Install without a marketplace](#install-without-a-marketplace). You get: - **Diagnostics as you type** — the findings of `flowpact lint` for the whole repository, closed files included, updated on every edit (unsaved ones too). Editing a reusable workflow updates its callers' findings at once. When `.github/flowpact/contracts/` exists, `flowpact check`'s contract findings (`FP801`–`FP805`) are included. - **Hover** — how an input, secret, output, env variable or matrix key is declared, where its value comes from and where it flows, through every level of nesting. - **Go to definition** across workflow calls and local actions: from `with: config:` to the callee's input, from `needs.build.outputs.url` to the reusable workflow's output, from `steps.x.outputs.y` to the action's output, from `steps.x.outcome` to the step, and from `env.X` to the step's own `env:`. Into [other repositories' workflows and actions](#remote-workflows-and-actions) too, once their sources are cached. - **Find references** and **highlights** across files, and **rename** an input, secret or output in every file that names it. - **Completion** of the inputs and secrets a call or step does not pass yet, for calls into other repositories too, from the lockfile. The server treats every directory with a `.github` folder as a repository, and, for a file with no `.github` folder above it, the root of its git repository: a repository of an action at its root works too. Monorepos and nested repositories need no configuration: the workspace folders are analyzed when the editor starts, and a repository nested inside one once you open one of its files. Your [config](https://ciatlas.github.io/flowpact/docs/configuration) (severities, overrides, ignores) applies as in the CLI. ## VS Code [#vs-code] Install **flowpact** from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=flowpact.vscode-flowpact), or from [Open VSX](https://open-vsx.org/extension/flowpact/vscode-flowpact) in VSCodium, Cursor, Windsurf and other editors built on VS Code: ```bash code --install-extension flowpact.vscode-flowpact ``` It bundles the language server, so nothing else needs to be installed, and works in VS Code 1.101 and later. The server starts when the workspace has workflows or an `action.yml`, at a folder's root or nested deeper, or when you open one; other workspaces only load the extension. It complements GitHub's [GitHub Actions](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions) extension, which completes and validates workflow syntax file by file: flowpact adds what crosses files (the data flow through reusable workflows and local actions, go to definition and references across them), and by default hides the four rules both would report (`flowpact.overlappingRules`). ### Install without a marketplace [#install-without-a-marketplace] Each [GitHub release](https://github.com/ciatlas/flowpact/releases) attaches the extension as `flowpact-vscode-X.Y.Z.vsix`, the same file published to the Marketplace and Open VSX, with its signed provenance. Where your network or policy blocks both registries: 1. **Download** the `.vsix` from the release's **Assets**, or with the GitHub CLI: ```sh gh release download vX.Y.Z --repo ciatlas/flowpact --pattern 'flowpact-vscode-*.vsix*' ``` 2. **Verify** that the release workflow built it (optional, recommended; see [Verify a release](https://ciatlas.github.io/flowpact/docs/security#verify-a-release)). Online, or offline against the bundle attached next to it: ```sh gh attestation verify flowpact-vscode-X.Y.Z.vsix --repo ciatlas/flowpact gh attestation verify flowpact-vscode-X.Y.Z.vsix --repo ciatlas/flowpact \ --bundle flowpact-vscode-X.Y.Z.vsix.sigstore.json ``` 3. **Install** it. In the editor, open the Extensions view, then **⋯ → Install from VSIX…**, and pick the file. Or from a terminal, with the editor's command line (`code`, `cursor`, `codium`, `windsurf`): ```sh code --install-extension flowpact-vscode-X.Y.Z.vsix ``` The extension needs VS Code 1.101 or later (or an editor built on it). It bundles the language server, so it needs no network access once installed. An extension installed from a `.vsix` does not update itself while the registries are unreachable: install the next release's `.vsix` the same way, over the old one. To install it for a whole team, check the `.vsix` into a shared location and run the same command, or use your organization's extension policy. ## Hover [#hover] Hovering an input, secret, output, env variable, matrix key, job or `uses:` value shows a short card from flowpact: - **Header:** flowpact, the kind of symbol, and a link to this section. - **First line:** the symbol and where it belongs, with its declaration: type, required or optional, default, values. - **From / To:** where the value comes from (callers' values, upstream outputs, contexts such as `github.event.pull_request.title`) and where it goes (a callee's inputs, scripts, conditions), one hop each, with any further entries counted. A note in parentheses qualifies an entry as in [`flowpact trace`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-trace), such as `(when dispatched)` for a workflow input read through `github` (`github.event.inputs.`, `toJSON(github)`). `flowpact trace` shows the whole chain. - On a step output, a line says when it may be `''`: the step has an `if:` that can skip it. - On a caller's `with:` or `secrets:` key, the card shows what this call passes and where the value goes in the callee. - **Inside a `${{ }}` or a bare `if:`, away from a symbol:** how GitHub reads the expression there, a condition (`''`, `0`, `false` and `null` are false), a value passed on as text (`true` becomes `'true'`) or a field that takes a boolean or a number, and what it yields: `true` or `false`, `'true'` or `'false'`, the text of an input, or `''` when an optional input is omitted or a step is skipped. Outside a condition, it notes that `||` and `&&` give one of their operands as it is. See [Condition and value](https://ciatlas.github.io/flowpact/docs/concepts#condition-and-value). - On a remote `uses:` value, the card shows what the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) records: the commit, the inputs, secrets and outputs, and the secrets a reusable workflow reads without declaring them (only `secrets: inherit` passes those), or why the reference has no entry. On a remote call's `with:` or `secrets:` key it shows the input or secret as recorded there, and **Find All References** lists every call that passes it. A read of a remote call's or action's output says whether the reference declares it. See [Remote workflows and actions](#remote-workflows-and-actions). Other extensions add their own sections below it; GitHub's GitHub Actions extension, for example, describes the key's syntax. In a [contract](https://ciatlas.github.io/flowpact/docs/contracts) file, hover and go to definition work on what the contract records: its `path`, the inputs, secrets and outputs of its interface, the jobs and workflows of its `calls`, and its `consumers` with the inputs they pass and the outputs they read. Each leads to the workflow or action that declares it. ## Remote workflows and actions [#remote-workflows-and-actions] A `uses:` of another repository (`octo/ship/.github/workflows/deploy.yml@v1`, `octo/setup@v2`) has a file to open once its source is in your [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor): `flowpact remotes update` caches what it reads, and `flowpact remotes download` fills the cache for a lockfile someone else wrote. The file is the one at the commit the `uses:` runs: its own commit when it pins one in full (`@`), else the commit the [lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) records for its tag or branch. Then: - **Go to definition** on the `uses:` value opens the file (at `workflow_call:` for a reusable workflow); on a `with:` or `secrets:` key, the input or secret there; on `needs..outputs.` or `steps..outputs.`, the output. - **Hover** adds the workflow's or action's `name:` and the descriptions of its inputs and secrets. When the lockfile records another commit for a `uses:` pinned in full, the hover says so: run `flowpact remotes update`. Files in the cache are another repository's at a fixed commit: the server does not analyze them, and VS Code opens them read-only (other editors open them as files you should not edit). Without the source cached, the hover says to run `flowpact remotes download` (with `--github-com` for one read on github.com from an enterprise server), and links to the file on its host when that host is certain: github.com for an entry read there, or the API that `flowpact remotes update` reads, as `GITHUB_API_URL` (if the editor has it) or a github.com or GHE.com `origin` tells. For any other origin (an enterprise server without `GITHUB_API_URL`, an SSH alias, another forge) it gives no link rather than a wrong one. The editor finds a cached source on whichever host it was read from, so it needs no `GITHUB_API_URL` to open one, only to link it. If you keep the cache elsewhere (`--cache-dir`), set `flowpact.cacheDir` (`cacheDir` in other editors) to the same directory: VS Code's flowpact output names the one it reads. ## Quick fixes [#quick-fixes] A finding that flowpact knows how to fix offers it as a quick fix (**Ctrl+.** or **Cmd+.**, or the light bulb): | Quick fix | On | | --- | --- | | Rename to the name a "did you mean" points at | an input, secret, output or step id ([`FP102`](https://ciatlas.github.io/flowpact/docs/rules/fp102), [`FP108`](https://ciatlas.github.io/flowpact/docs/rules/fp108), [`FP202`](https://ciatlas.github.io/flowpact/docs/rules/fp202), [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301), [`FP304`](https://ciatlas.github.io/flowpact/docs/rules/fp304)) | | Add the missing required input or secret, under `with:` or `secrets:` | a call that leaves one out ([`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101), [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201)) | | Add the missing key to the `include` entries that lack it | a matrix value that is empty in some combinations ([`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401), [`FP402`](https://ciatlas.github.io/flowpact/docs/rules/fp402)) | | Remove the unused input, and what local callers pass for it | [`FP104`](https://ciatlas.github.io/flowpact/docs/rules/fp104), in a workflow or action no other repository uses | | Regenerate the contracts, every file as `flowpact generate` writes it | a contract finding ([`FP801`](https://ciatlas.github.io/flowpact/docs/rules/fp801)–[`FP805`](https://ciatlas.github.io/flowpact/docs/rules/fp805)) | | Remove a comparison with `''` from a condition: `x != ''` becomes `x`, `x == ''` becomes `!x` | [`FP507`](https://ciatlas.github.io/flowpact/docs/rules/fp507), when it is turned on | | Compare a text value with `''` where it is set, so that it is `'true'` or `'false'`: `x` becomes `x != ''` | a value read as a boolean that can be other text ([`FP506`](https://ciatlas.github.io/flowpact/docs/rules/fp506)) | An added key gets an empty value for you to fill in. A quick fix is offered only when the change is certain: none in a flow mapping (`{ … }`) or a file with CRLF line endings, and no removal from a [published](https://ciatlas.github.io/flowpact/docs/concepts#published-unit) workflow or action, whose callers in other repositories would break. Regenerating the contracts needs an editor that can create and delete files in an edit when a contract is new or gone (VS Code can), and none is offered when a contract path is a symlink. Every finding also offers **Accept this finding with an override**. It adds an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides) for it to the config, creating `.github/flowpact/flowpact.config.yml` when there is none. VS Code asks for the reason and, optionally, a date until which the finding is accepted. Other editors write a placeholder reason to replace (*Explain why this finding is accepted*). A finding in a workflow or action offers **Ignore FP… on this line with a comment** too. It adds an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) on a line of its own above the finding's (`# flowpact: ignore[FP501]`), or adds the rule to a comment that accepts that line already. For a finding in a `run: |` script, the comment goes above the `run:` line. Write the reason after the `]`. The same fixes are in the [JSON report](https://ciatlas.github.io/flowpact/docs/cli#json-report) as `suggestions`, and in SARIF as `fixes`. ## Rename [#rename] **Rename Symbol** (**F2**) on an input, secret or output renames it everywhere in the repository: where it is declared, where callers pass it, and where it is read (`inputs.`, `needs..outputs.`, `steps..outputs.`). Start from any of them. A job's outputs rename the same way. flowpact refuses a rename it cannot make whole, and says why: - the name is declared in another repository, or a step's script writes the output; - a read it cannot rewrite, such as `inputs['name']`; - the new name is taken or invalid; - a caller passes the secret with `secrets: inherit`. A [published](https://ciatlas.github.io/flowpact/docs/concepts#published-unit) workflow or action has callers in other repositories that the rename breaks: VS Code asks you to confirm, and other editors show a warning. Afterwards, regenerate the [contracts](https://ciatlas.github.io/flowpact/docs/contracts) (a quick fix offers it) and update any [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides) that targets the old name. ## Completion [#completion] Under a call's or step's `with:` or `secrets:`, completion offers the inputs or secrets it does not pass yet, required ones first, with their type, default and description. A local reusable workflow or action declares them; for a call into another repository, they come from the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces), without a network. The descriptions of a remote reference's inputs need its [cached source](#remote-workflows-and-actions). ## Settings [#settings] In VS Code and the editors built on it, under **Settings → Extensions → flowpact**: | Setting | Default | Description | | --- | --- | --- | | `flowpact.plugins` | `true` | Load the [plugins](https://ciatlas.github.io/flowpact/docs/custom-rules) the config lists. They run JavaScript from the repository, so they never load in an untrusted workspace (Restricted Mode), whatever this setting says. | | `flowpact.contracts` | `auto` | Report contract drift and breaking interface changes: `auto` when `.github/flowpact/contracts/` exists, `on` or `off`. | | `flowpact.overlappingRules` | `auto` | `FP502`–`FP505` (expression syntax, schema, YAML syntax, context availability) repeat checks the [GitHub Actions](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions) extension makes. `auto` hides them in files you open in the editor while that extension runs (it checks those files, and keeps its findings after you close them); `show` or `hide` them everywhere. | | `flowpact.hiddenRules` | `[]` | Rule codes not to show in the editor. To turn a rule off in the CLI and CI too, set it to `off` in the config. | | `flowpact.cacheDir` | `""` | flowpact's cache directory, as `flowpact remotes update --cache-dir` takes it: Go to Definition opens the [sources of remote workflows and actions](#remote-workflows-and-actions) from its `remotes` directory. An absolute path, or one under `~`; empty for `FLOWPACT_CACHE_DIR`, else the per-user cache. | | `flowpact.trace.server` | `messages` | When the output's log level is Trace: `messages` names each message between VS Code and the server, `verbose` adds its content. | **Logs:** the **flowpact** output channel (**flowpact: Show Output**). Its log level (**Developer: Set Log Level…**) is also the server's: set it to Debug to see every stage of the analysis, or to Trace for the protocol messages too. VS Code's own extension host log can say `Not activating extension 'flowpact.vscode-flowpact': Timed out while searching…` in a large workspace even though flowpact runs: it then starts after VS Code's startup instead. The output channel and the language status item show its real state. **Commands:** **flowpact: Restart Language Server** — also needed after you edit a plugin, since a loaded plugin stays loaded — and **flowpact: Show Output**. ## Workspace trust [#workspace-trust] In an untrusted workspace (Restricted Mode), everything works except plugins, which run code from the repository. Trusting the workspace loads them without a restart; the language status item next to the file type says when they are off. Plugins load only for repositories inside the workspace folders: not for a file opened from elsewhere, nor for a repository above the folder you opened. ## Limitations [#limitations] - Completion covers the keys of `with:` and `secrets:` only, not workflow syntax or expressions: GitHub's Actions extension completes those. ## Other editors [#other-editors] `flowpact lsp` starts the same server over stdin/stdout, for any editor with an LSP client. It needs flowpact [installed](https://ciatlas.github.io/flowpact/docs/installation#command-line). Settings are read from the client's `initializationOptions`, and from `workspace/didChangeConfiguration` under `flowpact`: | Setting | Default | Description | | --- | --- | --- | | `plugins` | `false` | Load the plugins the config lists. Enable this only for repositories you trust. | | `contracts` | `auto` | `auto`, `on` or `off`, as above. | | `hiddenRules` | `[]` | Rule codes not to show. | | `cacheDir` | unset | flowpact's cache directory (an absolute path) for the [sources of remote references](#remote-workflows-and-actions); unset for `FLOWPACT_CACHE_DIR`, else the per-user cache. | | `logLevel` | `info` | `silent`, `error`, `warn`, `info`, `debug` or `trace`, sent to the editor's log. | ### Neovim [#neovim] With Neovim 0.11 or later: ```lua vim.lsp.config('flowpact', { cmd = { 'flowpact', 'lsp' }, filetypes = { 'yaml' }, root_markers = { '.github' }, }) vim.lsp.enable('flowpact') ``` To use the plugins the config lists, add `init_options = { plugins = true }`. # Quickstart (https://ciatlas.github.io/flowpact/docs/getting-started) A few minutes, at the root of a repository with workflows, with Node.js 22 or newer. `npx` runs flowpact without installing it; to install it, or to start in the editor or in GitHub Actions instead, see [Install](https://ciatlas.github.io/flowpact/docs/installation). ### Lint the repository [#lint-the-repository] ```sh npx flowpact lint ``` There is nothing to configure. flowpact reads every workflow and every local action it reaches, and its own files when they exist: | File | What it is | | --- | --- | | `.github/workflows/*.yml` | Your workflows. | | `action.yml` | Your local actions: under `.github/actions/`, the repository's own at the root, and any directory a `uses: ./path` points to. | | `.github/flowpact/flowpact.config.yml` | The [config](https://ciatlas.github.io/flowpact/docs/configuration), when you need one. | | `.github/flowpact/remotes.lock.yaml` | The interfaces of workflows and actions in other repositories (step 4). | | `.github/flowpact/contracts/` | [Contracts](https://ciatlas.github.io/flowpact/docs/contracts), when you publish workflows. | | `.github/workflows/actions.lock` | GitHub's own lockfile, when you have one ([what flowpact reads in it](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock)). | It always analyzes the whole repository, because most problems span files. A step's `./path` is resolved through the job's `actions/checkout` steps, since it is relative to the runner's workspace. flowpact writes nothing unless you ask it to. ### Read a finding [#read-a-finding] Each finding shows, top to bottom: | Part | Meaning | | --- | --- | | `✖ ERROR FP401 empty-binding-for-matrix-combo` | The severity, the rule's stable code and its name. | | message | What is wrong, in one sentence. | | `▶ file:line:col` and the code | Where, with the expression underlined. | | `matrix` | The matrix combinations it affects (matrix rules only). | | `context` | Related places: the call chain from the top-level workflow, the `include` entry, the input that receives the value. | | `why` / `fix` | Why it matters, and what to change. | | `docs` | The rule's page (a link in terminals that support them). | The run ends with a summary: counts per severity, the files, jobs and matrix combinations, and the most frequent codes. `npx flowpact explain FP401` prints a rule's page in the terminal. ### A clean run [#a-clean-run] The exit code is `0` without errors and `1` with errors (or warnings, with `--fail-on warning`). See [exit codes](https://ciatlas.github.io/flowpact/docs/cli#exit-codes). ### Check the calls into other repositories [#check-the-calls-into-other-repositories] A call to a workflow or action in another repository (`uses: actions/setup-node@v6`) is checked once flowpact knows its interface. Record the interfaces once, and commit the file: ```sh npx flowpact remotes update # writes .github/flowpact/remotes.lock.yaml npx flowpact lint ``` `remotes update` reads each reference's workflow file or `action.yml` through the GitHub API, with `GH_TOKEN`, `GITHUB_TOKEN` or your `gh` sign-in (public repositories need none). After it, a call that passes an input the action no longer has is a finding like any other: ```text ✖ ERROR FP102 unknown-input actions/setup-node@v6 has no input "always-auth" ▶ .github/workflows/release.yml:10:11 8 │ with: 9 │ node-version: 24 10 │ always-auth: true │ ━━━━━━━━━━━ ``` Lint reads only the committed file, so it needs no network. Run `remotes update` again when you move a reference to another version, or on a schedule: it says what each change does to your calls ([When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes)). ### Follow a value [#follow-a-value] ```sh npx flowpact trace pipeline.yml:config # where does this input go? npx flowpact trace run-suite.yml:config --up # where does this value come from? npx flowpact graph # which workflows call which ``` [Follow a value](https://ciatlas.github.io/flowpact/docs/tracing) shows how to read the output, and the same flow in the editor. ### Narrow it down [#narrow-it-down] ```sh npx flowpact lint .github/workflows/release.yml # report on one file (all is analyzed) npx flowpact lint --only FP401,FP101 # run some rules npx flowpact lint --hide-info # list errors and warnings only ``` A first run on a large repository can list many findings: [Adopt it in an existing repository](https://ciatlas.github.io/flowpact/docs/adopting) says where to start. ## Next steps [#next-steps] VS Code, VSCodium, Cursor, Neovim and other LSP editors. The GitHub Action, or the CLI in any CI. Fix what matters first, accept the rest with a reason. Contracts and impact mode. ## Install [#install] [Install](https://ciatlas.github.io/flowpact/docs/installation) has every way to install flowpact: npm, the GitHub Action, the editor extensions. ## Exit codes [#exit-codes] The exit codes are listed with the [CLI reference](https://ciatlas.github.io/flowpact/docs/cli#exit-codes). # How it works (https://ciatlas.github.io/flowpact/docs/how-it-works) flowpact is a static analyzer. Nothing is executed and no GitHub API is called during analysis; everything comes from the files in your repository, including the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) for calls into other repositories. Only `flowpact remotes update`, `--fetch-remotes` and the action's `remotes: fetch` read the GitHub API, when you ask them to. ```mermaid flowchart TD accTitle: From YAML to findings Y["Workflows and local actions (YAML)"] IR["IR: jobs, steps, interfaces, positions"] X["Expressions, parsed with @actions/expressions"] G["Data-flow graph: symbols and edges"] RL[("remotes.lock.yaml")] MX["Matrix expansion: every include and exclude"] C[("Contracts, in flowpact check")] RU["59 rules"] O["Overrides: reason, expiry"] REP["Terminal · JSON · Markdown · SARIF · editor · annotations"] Y --> IR IR --> X X --> G RL -.-> G G --> MX MX --> RU C -.-> RU RU --> O O --> REP ``` ### 1. Load and build the IR [#1-load-and-build-the-ir] Every workflow and local action is parsed with exact source positions into an intermediate representation: triggers, the `workflow_call` / `workflow_dispatch` interface (inputs with type/required/default, secrets, outputs), env at every scope, jobs (`needs`, `if`, `strategy.matrix`, `uses`, `with`, `secrets` / `inherit`, outputs) and steps (`id`, `uses`, `with`, `env`, `run`). Files are also validated against GitHub's schema with [`@actions/workflow-parser`](https://www.npmjs.com/package/@actions/workflow-parser) — the parser behind GitHub's Actions language service — and reported as `FP503`. Syntax GitHub already runs but the parser does not accept yet (background steps, `cache-mode`) is allowed, and keys GitHub accepts but ignores are warnings, not errors. Local references are followed until closure: `uses: ./.github/workflows/x.yml`, `uses: ./path/to/action`, `uses: $/path` (GitHub's reference to this repository at the running commit), and `owner/repo/...@ref` when it points at this same repository. A job's `uses: ./...` and every `$/...` are relative to the repository root. A step's `uses: ./path` is relative to the runner's workspace, so flowpact walks each job's steps in order and maps the path through its `actions/checkout` steps: after a checkout of this repository at `path: src`, `./src/.github/actions/build` is this repository's `.github/actions/build`. A composite action's steps run in the caller's workspace, so they are resolved for each caller, and a checkout or script inside the action changes what the caller's later steps see. A path flowpact cannot read (in another repository's checkout, in a checkout of this repository at another ref, outside the workspace, or written by an earlier step's script) is reported as [`FP610`](https://ciatlas.github.io/flowpact/docs/rules/fp610) and not verified; a path that lands in this repository and does not exist, or that no checkout puts where it points, is [`FP606`](https://ciatlas.github.io/flowpact/docs/rules/fp606). ### 2. Parse every expression [#2-parse-every-expression] Every `${{ }}` (and every bare `if:` condition) is parsed with GitHub's [`@actions/expressions`](https://www.npmjs.com/package/@actions/expressions) into an AST. flowpact extracts typed references such as `inputs.config`, `needs.build.outputs['version']`, `steps.meta.outputs.tag`, `matrix.os` or `github.event.inputs.x`, each with its own line and column. ### 3. Build the graph [#3-build-the-graph] References become edges between **symbols** with stable ids, for example `.github/workflows/test.yml#inputs.config` or `.github/workflows/ci.yml#jobs.build.outputs.version`: - `with:` on a reusable call or local action **binds** a caller expression to a callee input; - step output → job output → `workflow_call` output → the caller's `needs..outputs.`; - `secrets: inherit` is expanded to the secrets the callee tree actually reads; - `needs`, `calls` and `uses` edges describe the structure. `flowpact trace` is a walk over this graph, `flowpact graph` draws its call structure, and `flowpact lint --dump-graph graph.json` writes it out. The call structure of the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture, as `flowpact graph --format mermaid` draws it: ../../generated/deep-nesting.mmd ### 4. Expand matrices — the part that catches silent empties [#4-expand-matrices--the-part-that-catches-silent-empties] Matrices are expanded with GitHub's exact rules: cartesian product of the dimensions, `exclude` partial matches, then each `include` entry is merged into every original combination it does not conflict with — or becomes a new combination. (The implementation is checked against GitHub's documented examples and against an independent reference implementation with property-based tests.) Every `with:` value and every expression in the job is then **evaluated once per combination** with a partial evaluator that implements GitHub's operators and functions (`||`, `&&`, `==`, `format`, `contains`, `fromJSON`, …). A missing matrix key evaluates to `null` and carries a *taint*. If that taint survives into a value — and is not neutralized by a fallback such as `matrix.config || 'default'` — the binding is reported with the exact combinations (`FP401`, `FP402`). Values that depend on runtime state (`github.sha`, `fromJSON(needs.setup.outputs.matrix)`) evaluate to *unknown* and are never guessed at; runtime-computed matrices are reported as unverifiable (`FP403`) unless you declare their keys under [`matrixShapes`](https://ciatlas.github.io/flowpact/docs/configuration#matrix-shapes). ### 5. Compare with the contracts (`flowpact check`) [#5-compare-with-the-contracts-flowpact-check] In check mode, flowpact builds a [contract](https://ciatlas.github.io/flowpact/docs/contracts) for every workflow and local action from the graph — interface, calls, local action uses and consumers — and compares it with the committed file in `.github/flowpact/`. The comparison is semantic: each difference is classified as breaking or non-breaking, and missing, orphaned and unreadable contract files are recorded. `flowpact generate` uses the same comparison to decide what to write. ### 6. Run rules [#6-run-rules] Rules are small functions over the graph (and, in check mode, the contract comparison). Each finding carries a code, severity, message, primary location, related locations (the call chain, outermost first), affected combinations, the symbol id, why/fix text and a docs URL — plus a stable fingerprint that survives line shifts. Built-in rules and [plugin rules](https://ciatlas.github.io/flowpact/docs/custom-rules) run the same way. Findings outside the paths you asked for, or matching `ignore` patterns, are dropped after analysis, so cross-file rules still see the whole picture. ### 7. Apply overrides and ignore comments [#7-apply-overrides-and-ignore-comments] Each remaining finding is matched against the [overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides) in the config by rule and symbol or file, then against the [ignore comments](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) on its line. Accepted findings move to a separate `suppressed` or `ignoredByComment` list with the reason that accepted them. Then a last set of rules checks the overrides and comments themselves: expired (`FP901`, the findings come back), unused (`FP902`, `FP905`), expiring soon (`FP903`) and invalid comments (`FP904`). ### 8. Report [#8-report] The same result is rendered for the terminal, as JSON, Markdown or SARIF, and the exit code is derived from the counts and `--fail-on`. ## What flowpact deliberately does not do [#what-flowpact-deliberately-does-not-do] - **Guess runtime values.** Anything that depends on events, previous job results or scripts is *unknown*, so flowpact stays quiet rather than produce false positives. - **Analyze other repositories' jobs.** A call into another repository is checked against the interface the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) records for it (the inputs, secrets and outputs), not against what its jobs do. Without an entry, a call to a reusable workflow in another repository is reported as unverified ([`FP603`](https://ciatlas.github.io/flowpact/docs/rules/fp603)). - **Replace actionlint.** actionlint checks single files in depth (shell scripts, action inputs of marketplace actions, runner labels). Run both — see [Comparison](https://ciatlas.github.io/flowpact/docs/comparison). # Impact mode (https://ciatlas.github.io/flowpact/docs/impact-mode) Impact mode fails a pull request that declares a smaller release than its changes need, such as a `fix:` title on a change that renames a job or removes an output of a published reusable workflow. It grades every change callers can see as **major, minor, patch or none**, and compares that with the declared impact: by default the pull request's Conventional Commits title, which release tools such as release-please read from the squash commit. In the GitHub Action, turn it on with `impact: auto` ([setup](#github-action)). Callers pin a tag such as `@v1` and take every release in it. Rename a job, and their branch protection waits forever for the old check name (_Expected — Waiting for status to be reported_), while nothing fails in your repository. ```sh flowpact impact --base origin/main --title "fix: tidy the test job" ``` ```mermaid flowchart TD accTitle: How impact mode decides T["The title: fix: tidy the test job"] D["Declared: patch"] B["The changes to published units, base to head"] Q["Required: major (a job renamed, an output removed)"] CMP{"declared ≥ required?"} P["Pass"] F["FP810: retitle as feat!:"] T --> D B --> Q D --> CMP Q --> CMP CMP -->|"yes"| P CMP -->|"no"| F ``` ## What is graded [#what-is-graded] Only **published** units, the ones other repositories call: - every reusable workflow (`on: workflow_call`), except files whose name starts with `_` (`_build.yml`), the convention for internal ones; - the action at the repository's root (`action.yml`, what `uses: owner/repo@ref` runs); - or, instead, what [`impact.publish`](#configuration) lists, such as `*/action.yml` in a repository of several actions (`**/action.yml` includes the root one). Your own CI workflows and `.github/actions/**` are not graded. An internal workflow counts where a published one calls it, since its check names appear under the caller's. | Change to a published unit | Required impact | | --- | --- | | A check name is gone: a job renamed or removed, its id changed when it has no `name`, a matrix key or value changed or removed, `${{ }}` added to or removed from `name`, a nested call removed | major | | Job id renamed, check name unchanged | none | | A new check name (a new job or matrix value) | minor | | `workflow_call` input or secret removed, made required or added as required, input type changed, choice option removed | major | | Output removed (callers read `''`) | major | | An artifact uploaded with `actions/upload-artifact`, by the unit or by what it runs, is no longer uploaded under that name: a caller's job that downloads it fails | major (uncertain when the name is chosen at run time) | | An output set on every run is now set only when an `if:` that reads a context holds: callers read `''` otherwise | major, uncertain ([`FP814`](https://ciatlas.github.io/flowpact/docs/rules/fp814)) | | Optional input, secret or output added | minor | | Input default changed | minor | | Reusable workflow or action moved or deleted, or `workflow_call` removed | major | | A published unit no longer parses | major | | A job, its own or a called workflow's, needs a new or higher `permissions:` scope: callers that grant less fail when the run starts. A job that calls a workflow and sets `permissions:` (or whose workflow does) requests them for all of it, so only its own count | major | | Action `runs.using` changed (`node20` → `node24`) | major | | A job, its own or a called workflow's, needs a runner label or group it did not need (`[self-hosted, gpu]`): callers without one never start it | major | | A job's runners are now chosen at run time (`runs-on: ${{ inputs.runner }}`) | major, uncertain ([`FP814`](https://ciatlas.github.io/flowpact/docs/rules/fp814)) | | Another GitHub-hosted image (`ubuntu-22.04` → `ubuntu-24.04`), or fewer runner labels | patch | | A job gains, changes or loses its `environment:`: the caller's environment of that name, its protection rules and secrets, now applies or no longer does | minor (uncertain when the name is chosen at run time) | | A new third-party action or workflow inside a published unit: callers' allow-lists and SHA-pinning policies apply | minor | | Nothing above, but the jobs or steps changed, the unit's or those of what it runs (comments, formatting and key order aside) | patch | | Narrower permissions, descriptions, `workflow_dispatch` inputs | none | Callers' branch protection is not visible from your repository, so every check name a published workflow reports counts as required. Names are compared [as GitHub forms them](#how-check-names-are-formed). A name built from the workflow's inputs is compared by its template: `Test ${{ inputs.os }}` → `Tests ${{ inputs.os }}` is a rename, whatever callers pass. ### Only some units [#only-some-units] ```sh flowpact impact actions/deploy --base origin/main --title "$PR_TITLE" ``` Paths (files or directories) grade only the published units within them. `flowpact impact`, `lint --impact` and `check --impact` take them, as do the action's `paths` input and the [API](https://ciatlas.github.io/flowpact/docs/api). Use them where each unit is released on its own, such as one job per action. **This narrows the gate**: a breaking change outside the paths passes. Prefer directories (`actions/`) to files. A removed or renamed unit is graded only when its old path is among the paths: after a move from `actions/old` to `actions/new`, `flowpact impact actions/new` grades the new unit (minor) but not the removal (major). A path such as `actions/old` serves the pull request that removes it. Once that is merged, the baseline lacks the unit too, so the path names nothing, and later runs fail on it until it is taken out. A directory that holds other units, such as `actions/`, keeps working. On `merge_group`, and on a `push` with no commit before it or with `impact: auto` and no `base-ref`, there is no baseline to tell a removed path from a typo. A missing path, or one with no workflow or action left in it, is then a warning, not an error. The pull request's run usually refuses it first, but not on a new branch's first push or in a workflow that runs only on `push`: use `impact: on` there, which compares each push with the commit before it (all but a new branch's first). On the other events without a baseline, such a path is refused. A published unit is left out when both the **baseline's** and the pull request's [`ignore`](https://ciatlas.github.io/flowpact/docs/configuration#reference) match it. A pull request's own `ignore` edit never lets a change through: a unit it adds is graded until the edit is merged (the run notes `impact: this pull request changes what ignore leaves out of impact mode (…); that applies after it is merged`), and one it removes is graded at once. Every other finding follows the pull request's own `ignore`. When `ignore` leaves out every published unit, nothing is graded. `impact: auto` skips the run, saying why; `impact: on` and the CLI still check the declaration against a required impact of `none`, so a label that declares more than the title is still `FP811`. `FP811`–`FP813` point at no change, so they go on the first published file graded, else the first workflow or action file `ignore` leaves in (within the paths). With neither, impact mode is skipped and says why, such as `impact: skipped (nothing within the paths to grade or to report on)`. The terminal and Markdown reports add `only within : graded `, and `left out by ignore: ` when `ignore` left out published units. The JSON report's `impact.scope` lists the `paths` and the `units` graded, and `impact.ignored` the units left out. ## Where the declared impact comes from [#where-the-declared-impact-comes-from] Exactly one source is **authoritative** (`impact.declaredBy`): the one your release tool reads. | Source | From | Means | | --- | --- | --- | | `explicit` | `--expect`, action input `expected-impact` | as given | | `title` (default) | `--title`, or the pull request title in GitHub Actions | `type!:` → major, `feat` → minor, `fix` / `perf` → patch, other types → none | | `labels` | `--labels`, or the pull request labels in GitHub Actions | `semver:major` / `semver:minor` / `semver:patch` / `semver:none` | - The **title** describes the squash commit. A title that is not a Conventional Commit is _not declared_, even when a `semver:*` label is set. - **Other sources are advisory.** One that declares more (a `semver:major` label on a `fix:` title) is an error: the release tool would cut a patch. - **Release pull requests** (release-please's `chore(main): release 0.3.0`, or the `autorelease: pending` label) compare everything since the **last release tag** with the proposed version. release-please's settings for the root package apply: `bump-minor-pre-major` (before 1.0, `0.2.0` → `0.3.0` is a major release), `bump-patch-for-minor-pre-major`, `include-v-in-tag` and component tags (`my-action-v0.2.0`). - Without a declaration, flowpact reports the required impact (`FP813`) and does not fail. Declaring more than needed is never an error, since a release may hold changes flowpact does not grade. Nor is a `patch` change under a `none` declaration. ## Findings [#findings] | Code | Severity | Reported when | | --- | --- | --- | | [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) `impact-under-declared` | error | The changes require more than declared (at least minor). | | [`FP811`](https://ciatlas.github.io/flowpact/docs/rules/fp811) `impact-declaration-conflict` | error | An advisory source declares more than the authoritative one. | | [`FP812`](https://ciatlas.github.io/flowpact/docs/rules/fp812) `impact-over-declared` | info | The declaration is bigger than the changes require. | | [`FP813`](https://ciatlas.github.io/flowpact/docs/rules/fp813) `impact-undeclared` | info | Nothing is declared; the required impact is reported. | | [`FP814`](https://ciatlas.github.io/flowpact/docs/rules/fp814) `impact-uncertain` | warning | A change depends on something flowpact cannot evaluate (a check name built from `vars` or the event, a runtime matrix, an output that is now set only when an `if:` holds). Not counted unless `impact.uncertain: fail`. | ## The baseline [#the-baseline] | Run | Compared with | | --- | --- | | `--base ` / action input `base-ref` | that ref | | `pull_request` | the base commit of the pull request | | `push` | the commit before the push (a new branch or tag is skipped) | | release pull request | the last release tag (see above) | | anything else | `origin/HEAD`, else `origin/main`, else `origin/master` | `merge_group` runs are skipped (the pull request was checked), and so is a run whose baseline is the checked-out commit. ## Using it [#using-it] ### GitHub Action [#github-action] ```yaml on: pull_request: # edited / labeled: re-check when the title or the labels change types: [opened, edited, synchronize, reopened, labeled, unlabeled] jobs: flowpact: runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@v7 - uses: ciatlas/flowpact@v0.29 with: impact: auto # off (default) | auto | on ``` - `auto` turns impact mode on for pull requests in repositories that publish a workflow or action. With the `paths` input, it skips a run when none is within them. - On a shallow checkout, the action fetches the base commit (and the release tags, for a release pull request) itself. `contents: read` is enough, and `persist-credentials: false` works. - The job summary gets an **Impact** section, and the outputs `required-impact`, `declared-impact` and `impact-ok` let later steps react. - Use `pull_request`. flowpact refuses `pull_request_target`, which checks out the default branch. ### CLI [#cli] ```sh flowpact impact --base origin/main --title "$PR_TITLE" # only the impact verdict flowpact check --impact --base origin/main --expect minor # everything check does, plus impact ``` | Option | Description | | --- | --- | | `[paths…]` | Grade only the published workflows and actions within these files or directories ([Only some units](#only-some-units)). Default: every published one. | | `--base ` | Baseline (default: the pull request base in GitHub Actions, else `origin/HEAD`). It must be in the clone (`git fetch`). | | `--expect ` | Declared impact: `none`, `patch`, `minor` or `major`. | | `--title ` | Pull request title to read the declaration from. | | `--labels ` | Pull request labels. | `--format json` adds an `impact` section to the report: the baseline, the required and declared impact, `ok`, and every graded change. ### Configuration [#configuration] ```yaml title=".github/flowpact/flowpact.config.yml" impact: publish: [.github/workflows/reusable-*.yml, '*/action.yml'] # what other repositories use declaredBy: title # explicit | title | labels labels: { major: breaking, minor: enhancement } # label names per level types: { feat: minor, fix: patch, perf: patch, deps: patch } # Conventional Commits types uncertain: warn # warn | fail ``` The impact settings are read from the **baseline**, so a pull request cannot relax its own check: changed settings apply once it is merged. So are the severities and [overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides) of impact mode's rules (`FP810`–`FP814`): the pull request's own `rules:` cannot switch them off, its overrides cannot accept their findings, and no [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) can. `ignore` counts only where both sides match it ([above](#only-some-units)). A [base config](https://ciatlas.github.io/flowpact/docs/configuration#base-config) applies under the baseline's config too, and alone when the baseline has no valid config. It depends on whether the pull request's commits can change it: - **Outside the repository, or a file no commit tracks** (an organization's config checked out into a gitignored directory): no commit can change it, so it applies on both sides, `ignore` included. - **A file of the checked-out commit** is the pull request's version, so the baseline's impact settings leave it out. Its `ignore` counts on the baseline's side as the baseline has it: an edit applies after the merge. A symbolic link on the way counts as the baseline has it too. - **A file within a submodule** counts the same way, read at the baseline's commit of the submodule. Once merged, the commit the pull request records applies, not one checked out in its place (`git submodule update --remote`). When the clone lacks either commit (a submodule checked out at depth 1; use `fetch-depth: 0`), that side's `ignore` leaves nothing out, and the run says so. ## How check names are formed [#how-check-names-are-formed] Verified against the check runs GitHub reported for a lab repository with one workflow per case (`fixtures/checknames-lab`; a test requires an exact match): - A job's check name is its `name:`, trimmed, or the job id when it has no name or a blank one. The workflow name and file name are not part of it. - A matrix job gets the suffix ` (value1, value2)`, unless its name is dynamic: text around an expression (`Lit ${{ 'X' }}`) or an expression that reads anything (`${{ matrix.os }}`) gets none, so such names can collide. A name that is a single literal expression (`${{ 'Only' }}`) keeps the suffix. - The suffix lists the matrix dimensions in declared order. Keys an `include` adds to existing combinations are not shown; combinations an `include` creates show all their values. `null` and `''` are skipped, objects and arrays are flattened, and numbers are formatted like .NET (`3.10` → `3.1`, `1e15` → `1E+15`). - A job in a called workflow reports `caller job / callee job`, with one more ` / ` per nesting level. Callee names can read the caller's `with:` values. - A job skipped by its `if:`, or because a job it needs failed, reports **one** check with its raw name, and a skipped caller reports no ` / callee` checks at all. # Introduction (https://ciatlas.github.io/flowpact/docs) flowpact checks both sides of a reusable workflow or action: what it declares, and what its callers pass and read. - **You publish one:** each pull request is graded major, minor, patch or none against what callers use ([contracts](https://ciatlas.github.io/flowpact/docs/contracts), [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode)). - **You call one:** each call is checked against the version it targets, and each version bump before you take it ([remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces)). - **Inside a repository:** every value is followed across workflows, actions and matrix combinations. GitHub turns a missing one into an empty string and a green run; [59 rules](https://ciatlas.github.io/flowpact/docs/rules) report where. ```mermaid flowchart TD accTitle: Both sides of a shared workflow subgraph pub["org/ci-templates · publishes"] C["contracts and impact mode: each release graded"] end T["release v2.1.0 · tag v2"] subgraph app["org/app · calls"] L["remotes.lock.yaml and lint: each call checked"] end C -->|"graded: minor"| T T -->|"remotes update: graded against your calls"| L ``` It runs in your editor, your terminal and on every pull request. It reads your YAML and runs nothing from it, needs no config, and sends no telemetry. ## Is this for me? [#is-this-for-me] flowpact earns its place once workflows call each other, or other repositories call yours: - you publish reusable workflows or actions that other repositories call, and must not break them; - you call workflows and actions in other repositories, and Renovate or Dependabot move them to new versions; - reusable workflows and composite actions pass values down through several levels, and outputs back up; - a matrix with `include` entries feeds a reusable workflow, and every leg must get every value. A few standalone workflows with no calls between them? [actionlint](https://github.com/rhysd/actionlint) alone may be enough. Otherwise, use flowpact next to actionlint and [zizmor](https://github.com/zizmorcore/zizmor): see [flowpact and other tools](https://ciatlas.github.io/flowpact/docs/comparison). ## Try it [#try-it] Run it at the root of a repository; there is nothing to configure: ```sh npx flowpact lint ``` When your workflows call workflows or actions in other repositories, record their interfaces once, and those calls are checked too: ```sh npx flowpact remotes update # writes .github/flowpact/remotes.lock.yaml: commit it npx flowpact lint ``` The [Quickstart](https://ciatlas.github.io/flowpact/docs/getting-started) explains the output. ```yaml title=".github/workflows/flowpact.yml" name: flowpact on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA - uses: ciatlas/flowpact@v0.29 # pin to a commit SHA ``` Findings become annotations on the pull request and a job summary. See [Run on pull requests](https://ciatlas.github.io/flowpact/docs/ci). Install flowpact from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=flowpact.vscode-flowpact) or [Open VSX](https://open-vsx.org/extension/flowpact/vscode-flowpact). Findings appear as you type, for open and closed files, and hovering an input, secret or output shows where it comes from. Neovim and other editors run `flowpact lsp`: see [Editors](https://ciatlas.github.io/flowpact/docs/editors). ## I want to… [#i-want-to] Contracts and impact mode for what you publish. A drift check on a schedule, and a verdict on each bot pull request. A lockfile of their interfaces, checked offline. Run it once and read a finding. VS Code, VSCodium, Cursor, Neovim and other LSP editors. The GitHub Action, or the CLI in any CI. Every rule, from FP101 to FP903. Nothing to analyze, no findings in the editor, a reference that is not fetched. Organization defaults and rules, in an action of your own. What it reads and writes, signed releases, the threat model. **For AI assistants:** [llms.txt](https://ciatlas.github.io/flowpact/llms.txt) lists every page as Markdown, and [llms-full.txt](https://ciatlas.github.io/flowpact/llms-full.txt) holds them all in one file. # Install (https://ciatlas.github.io/flowpact/docs/installation) flowpact runs in three places, from the same engine: they read the same files and report the same findings. ```mermaid flowchart TD accTitle: One engine, three places to run it R[".github/: workflows, actions, config"] E["flowpact: graph, matrices, rules"] ED["Editor: findings as you type"] C["Command line: terminal and any CI"] A["GitHub Action: pull request annotations"] R --> E E --> ED E --> C E --> A ``` ## Command line [#command-line] The npm package and the command are both `flowpact`; it needs Node.js 22 or newer. To try it without installing anything, run it with `npx` at the root of a repository: ```sh npx flowpact lint ``` To pin the version for everyone working on the repository, and for its CI, add it as a development dependency: ```npm npm i -D flowpact ``` Install once and use `flowpact` anywhere: ```sh npm install --global flowpact flowpact lint ``` Run a given version without installing it: ```sh npx flowpact@0.29 lint ``` ```sh mise use --global npm:flowpact flowpact lint ``` ## GitHub Actions [#github-actions] The action needs neither Node.js nor an install step: it runs the bundled engine and turns findings into annotations on the pull request and a job summary. ```yaml title=".github/workflows/flowpact.yml" name: flowpact on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA - uses: ciatlas/flowpact@v0.29 # pin to a commit SHA ``` [Run on pull requests](https://ciatlas.github.io/flowpact/docs/ci) covers the setups for an application repository and for a repository of shared workflows, and [GitHub Action](https://ciatlas.github.io/flowpact/docs/action) lists every input and output. Other CI services run the command line. ## Editors [#editors] Install **flowpact** from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=flowpact.vscode-flowpact). The extension bundles the language server: it needs neither Node.js nor the npm package. In VSCodium, Cursor, Windsurf and other editors built on VS Code, install **flowpact** from [Open VSX](https://open-vsx.org/extension/flowpact/vscode-flowpact). Each release attaches the extension as a `.vsix` file: see [Install without a marketplace](https://ciatlas.github.io/flowpact/docs/editors#install-without-a-marketplace). Neovim and other editors with a Language Server Protocol client run `flowpact lsp` from the npm package: see [Other editors](https://ciatlas.github.io/flowpact/docs/editors#other-editors). ## Verify a release [#verify-a-release] Each release is built by the repository's release workflow, which attests the npm package, the action and the extension, with an SBOM; the npm package is published with provenance. See [Verify a release](https://ciatlas.github.io/flowpact/docs/security#verify-a-release). Run it on a repository and read a finding. A first run with many findings. # Roll it out across an organization (https://ciatlas.github.io/flowpact/docs/integrating) Organizations that cannot use a third-party action, or that want their own defaults, rules and reports, can run flowpact their way without forking it: [copy the action](#copy-the-action), [run the CLI in a step](#run-the-cli-in-a-step), [write your own action](#write-your-own-action) on the API, or [write a composite action](#a-composite-action). The organization owns the policy (rules, when to fail, where reports go); flowpact stays unmodified, verified, and updated with a version bump. ## What is stable [#what-is-stable] The interfaces to build on (the CLI, the JSON report and SARIF, the config and contract schemas, rule codes, plugin rules, the action's inputs and outputs, and the API), and what is not covered, are listed in [Stability](https://ciatlas.github.io/flowpact/docs/stability). ## Copy the action [#copy-the-action] The flowpact action is a self-contained JavaScript action (`node24`): it uses no other actions and installs nothing when it runs. Each [release](https://github.com/ciatlas/flowpact/releases) has it as an archive, `flowpact-action-X.Y.Z.tar.gz`: `action.yml`, the bundle, its license notices and SBOM. Copy it into a repository of your organization, where your action policy allows it: ```sh gh release download vX.Y.Z --repo ciatlas/flowpact --pattern 'flowpact-action-X.Y.Z.tar.gz' gh attestation verify flowpact-action-X.Y.Z.tar.gz --repo ciatlas/flowpact tar -xzf flowpact-action-X.Y.Z.tar.gz -C acme-flowpact # a clone of a new repository ``` Give the copy a repository of its own: the archive has flowpact's `LICENSE` at its root, which stays with the copy and would replace a `LICENSE` already there. Add your [defaults](#organization-defaults) and [rules](#organization-rules) next to it, and make them the defaults of its `base-config` and `plugin` inputs (0.10.0 and later): change the `default: ''` those two inputs already have in `action.yml`. Relative paths are read from the action's own directory: ```text acme/flowpact ├── action.yml # flowpact's, with the two defaults below ├── LICENSE # flowpact's ├── packages/action/dist/ # the bundle, as released ├── acme.base.yml └── rules/acme.mjs ``` ```diff title="action.yml (in your copy)" base-config: description: … required: false - default: '' + default: acme.base.yml plugin: description: … required: false - default: '' + default: rules/acme.mjs ``` Repositories then use `uses: acme/flowpact@` with every input of the [GitHub Action](https://ciatlas.github.io/flowpact/docs/action). In a private or internal repository, first allow that under Settings → Actions → General → Access. An empty `base-config` or `plugin` still means your defaults, but a workflow can set them to something else, and its `plugin` replaces your list rather than adding to it (list `rules/acme.mjs` with the workflow's own plugins). To enforce the policy, require the workflow centrally ([below](#run-the-cli-in-a-step)). To update, copy the next archive the same way and keep the two defaults. The action reaches the network only in [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) (a `git fetch` of the base commit), with `remotes: fetch` (GitHub API reads of the [remote](https://ciatlas.github.io/flowpact/docs/remote-interfaces) workflows and actions the lockfile lacks), and to upload regenerated contracts, which GitHub Enterprise Server does not support (set `upload-contracts: false` there); see [Security](https://ciatlas.github.io/flowpact/docs/security#network-and-telemetry). ## Run the CLI in a step [#run-the-cli-in-a-step] A `run:` step is not an action, so no action policy applies to it. The CLI is bundled with everything it needs and installs nothing; it needs only Node.js 22 or later, which GitHub-hosted runners have: ```yaml title=".github/workflows/flowpact.yml" jobs: flowpact: runs-on: ubuntu-latest permissions: contents: read steps: - uses: actions/checkout@v7 # pin to a commit SHA - name: flowpact env: GH_TOKEN: ${{ github.token }} FLOWPACT_VERSION: 0.29.2 run: | gh release download "v$FLOWPACT_VERSION" --repo ciatlas/flowpact \ --pattern "flowpact-$FLOWPACT_VERSION.tgz" --dir "$RUNNER_TEMP" gh attestation verify "$RUNNER_TEMP/flowpact-$FLOWPACT_VERSION.tgz" --repo ciatlas/flowpact tar -xzf "$RUNNER_TEMP/flowpact-$FLOWPACT_VERSION.tgz" -C "$RUNNER_TEMP" node "$RUNNER_TEMP/package/dist/index.js" lint --format github -o markdown:"$GITHUB_STEP_SUMMARY" ``` The step refuses to run a file whose [provenance](https://ciatlas.github.io/flowpact/docs/security#verify-a-release) does not verify: `gh attestation verify` fails it, with `HTTP 404: Not Found` for a file that GitHub holds no attestation for. Without network access at run time, verify the tarball once and commit the extracted `package/` folder to an internal repository as `tools/flowpact/` (its own `package.json` keeps the code an ES module whatever `package.json` the repository has); the step is then `node tools/flowpact/dist/index.js lint …`. Add `--base-config` and `--plugin` for your defaults and rules. On GitHub Enterprise Cloud, an organization [ruleset](https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-workflows-to-pass-before-merging) can require such a workflow in every repository, whichever of these ways it uses; the workflow must run on `pull_request`, `pull_request_target` or `merge_group`, and its repository must allow access from the others. ## Write your own action [#write-your-own-action] A JavaScript action of your own can run flowpact through its [API](https://ciatlas.github.io/flowpact/docs/api): `lint()`, `check()` and the other commands as functions, which return the report and render the annotations, the job summary and SARIF. It applies your defaults and rules like the CLI does (`baseConfig`, `plugins`), with the inputs and reports you choose, and its bundle installs nothing when it runs. [Write your own action](https://ciatlas.github.io/flowpact/docs/api#write-your-own-action) has a complete one. ## A composite action [#a-composite-action] An internal repository with a composite action that installs a pinned flowpact and runs it with your defaults. It uses `actions/setup-node` and installs from npm when it runs, so where your policy allows only your organization's actions or blocks network access, [copy the action](#copy-the-action), [run the CLI in a step](#run-the-cli-in-a-step) or [write your own action](#write-your-own-action) instead. ```text acme/flowpact-action ├── action.yml ├── package.json # flowpact, pinned to an exact version ├── package-lock.json # and its integrity hash ├── acme.base.yml # optional: organization defaults (below) └── rules/acme.mjs # optional: organization rules (below) ``` Create `package.json` and the lockfile with `npm install --save-exact flowpact@0.29`. The flowpact package has no dependencies of its own: everything it runs is bundled, with its license notices and an SBOM next to it. ```yaml title="action.yml" name: Acme flowpact description: flowpact with Acme's rules and reports inputs: command: description: lint, or check when the repository commits contracts default: lint runs: using: composite steps: - uses: actions/setup-node@v7 # pin to a commit SHA with: node-version: 22 - name: Install flowpact shell: bash run: npm ci --prefix "$GITHUB_ACTION_PATH" --ignore-scripts - name: Run flowpact shell: bash env: COMMAND: ${{ inputs.command }} # The repository's own plugins run its code: not on events that run a fork's code with secrets. NO_PLUGINS: ${{ contains(fromJSON('["pull_request_target", "workflow_run"]'), github.event_name) && '--no-plugins' || '' }} run: >- "$GITHUB_ACTION_PATH/node_modules/.bin/flowpact" "$COMMAND" --format github --base-config "$GITHUB_ACTION_PATH/acme.base.yml" --plugin "$GITHUB_ACTION_PATH/rules/acme.mjs" $NO_PLUGINS -o markdown:"$GITHUB_STEP_SUMMARY" -o flowpact.sarif ``` From one run, this gives: - the organization's defaults and rules, under each repository's own config; - an annotation on the file and line of each finding, in the run and the pull request (`--format github`); - the Markdown report in the job summary (`-o markdown:"$GITHUB_STEP_SUMMARY"`); - `flowpact.sarif`, for `github/codeql-action/upload-sarif` in the calling job or in the wrapper; - a failed step when there are errors (exit code `1`); add `--fail-on warning` or `--fail-on never` to change that. Repositories use it like any action, after `actions/checkout`. With `--root` (a repository in a subdirectory of the workspace), the paths in annotations, SARIF and Markdown links stay relative to the repository. Without access to the npm registry, install the npm package from a release instead: each [GitHub release](https://github.com/ciatlas/flowpact/releases) has `flowpact-X.Y.Z.tgz` with build provenance. [Verify it](https://ciatlas.github.io/flowpact/docs/security#verify-a-release), commit it to the wrapper and depend on the file (`npm install --save-exact ./flowpact-X.Y.Z.tgz`). ## Organization defaults [#organization-defaults] A [base config](https://ciatlas.github.io/flowpact/docs/configuration#base-config) holds settings for every repository, and each repository's own config goes on top of it. Pass it with the action's `base-config` input, the CLI's `--base-config` or the API's `baseConfig`: ```yaml title="acme.base.yml" rules: FP105: error # stricter than flowpact's default needs-without-data: info # an opt-in rule, on for everyone prod-deploy-needs-approval: error ignore: - .github/workflows/generated/ impact: declaredBy: labels # Acme declares release impact with labels ``` - `rules`, `limits` and `impact` settings merge key by key, and the repository's value wins: a repository can still set `FP105: warning`. `ignore` and `generated` lists add up. - Settings that name files of one repository (`overrides`, `matrixShapes`, `repository`, `impact.publish`) and `plugins` are config errors in a base config. - In [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode), the base config also applies under the baseline's config. One that the pull request's commits can change (a file of the repository, one within a submodule, or one a tracked symbolic link points at) is [read differently](https://ciatlas.github.io/flowpact/docs/impact-mode#configuration), so a pull request cannot relax its own check through it. One outside the repository, or checked out into a directory of the workspace that the repository does not track, applies on both sides. Repositories keep a config that works on its own: locally and in the editor, without the wrapper, flowpact uses the repository's config and its defaults. ## Organization rules [#organization-rules] Write your rules as [plugins](https://ciatlas.github.io/flowpact/docs/custom-rules) and ship them with your copy of the action or your wrapper, such as `rules/acme.mjs` with the `prod-deploy-needs-approval` rule from [Custom rules](https://ciatlas.github.io/flowpact/docs/custom-rules): - The action's `plugin` input, the CLI's `--plugin ` and the API's `plugins` load a plugin in addition to those the repository's config lists (the input reads relative paths from the action's directory, the flag and the API from the working directory; all take several). - The repository's own plugins run the repository's code, so the action skips them on untrusted events (`plugins: auto`), the CLI with `--no-plugins` and the API with `repositoryPlugins: false`. Your rules keep running: the action skips a `plugin` file only when it is in the checkout. - The base config sets how strict each rule is, and a repository can change that under `rules:` or accept a finding with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), like for built-in rules. Where the rule is not loaded (plain `flowpact lint`, the editor), those entries are [ignored with a warning](https://ciatlas.github.io/flowpact/docs/configuration#rules-that-are-not-loaded). ```yaml title=".github/flowpact/flowpact.config.yml (in one repository)" rules: FP105: warning # this repository wins over the base config overrides: - rule: prod-deploy-needs-approval target: .github/workflows/deploy.yml#jobs.hotfix reason: Hotfix deploys are approved in the incident channel (INC-142) expires: 2026-12-31 owner: '@acme/sre' ``` ## Reading the results [#reading-the-results] For a wrapper that decides by itself, run with `--fail-on never` and read the JSON report: ```sh flowpact lint --fail-on never --format json > flowpact.json jq -r '.findings[] | "\(.severity) \(.code) \(.loc.file):\(.loc.line)"' flowpact.json jq '.summary.errors' flowpact.json ``` - Exit codes: `0` no findings at or above `--fail-on`, `1` findings, `2` usage or config error, `3` internal error. - `fingerprint` stays the same across unrelated edits, so a finding can be tracked over time or compared with a baseline. - `symbol` names what the finding is about; it is the `target` of an override. - Logs go to stderr and never mix with the report on stdout. ## Keeping it current [#keeping-it-current] Renovate updates the wrapper's npm dependency, and pinned action references wherever flowpact's own action is used: ```json title="renovate.json" { "extends": ["config:recommended", "helpers:pinGitHubActionDigests"], "packageRules": [ { "matchPackageNames": ["flowpact", "ciatlas/flowpact"], "groupName": "flowpact", "minimumReleaseAge": "3 days" } ] } ``` - `minimumReleaseAge` waits a few days after a release before proposing it. - Read the **Breaking changes** section and the upgrade notes of a major update before merging it, and the release notes of a minor one, which can change what is reported; patch updates can be merged automatically (`"matchUpdateTypes": ["patch"], "automerge": true`). - `npm audit signatures` in the wrapper's CI checks that the installed version was published from this repository's release workflow. - Dependabot works the same way, with the `npm` and `github-actions` ecosystems. - [Your own action](#write-your-own-action) gets the same update of its npm dependency; rebuild its bundle with it. - A [copy of the action](#copy-the-action) or a [CLI run in a step](#run-the-cli-in-a-step) is updated by copying or downloading the next release the same way, verified again; for the step, that is the `FLOWPACT_VERSION` line. ## Why not extends [#why-not-extends] Tools such as ESLint let a config extend another file. flowpact's base config comes from the command line instead, for two reasons: - A repository's config that extends a file in the wrapper, or in a private package, points at something that is not there when a developer runs `flowpact lint` or opens the editor, so the config would fail everywhere but in CI. Passed by the wrapper, the base config applies where the wrapper runs, and the repository's config still works alone. - The organization applies its defaults: a repository cannot leave them out by deleting a line. ## Why not a fork [#why-not-a-fork] A fork that changes flowpact's code has to be rebuilt, re-verified and merged on every release, and its bundle no longer matches the signed release. A wrapper keeps flowpact unmodified and adds what your organization needs around it. If it needs something flowpact does not offer — a flag, an output, an extension point — [open an issue](https://github.com/ciatlas/flowpact/issues). # Remote interfaces (https://ciatlas.github.io/flowpact/docs/remote-interfaces) A call into another repository (`uses: octo/ship/.github/workflows/deploy.yml@v1`, `uses: octo/setup@v2`) is taken on trust: nothing checks that the inputs you pass exist, have the right type, or include the required ones ([`FP603`](https://ciatlas.github.io/flowpact/docs/rules/fp603) says so for remote workflows). A **remote interfaces lockfile** records each one's inputs, secrets and outputs, and the permissions a reusable workflow's jobs request, at the commit its reference resolved to. ```mermaid flowchart TD accTitle: From the remote interfaces lockfile to your calls U["flowpact remotes update"] L[("remotes.lock.yaml")] W["Your workflows: uses: octo/setup@v2"] LINT["flowpact lint, check, the editor: no network"] F["FP101 · FP102 · FP103 · FP201 · FP202 · FP205 · FP301 · FP613"] B["A new version, or a tag that moved"] U -->|"GitHub API"| L L --> LINT W --> LINT LINT --> F B -.->|"graded against your calls"| U ``` The lockfile records what each reference accepts and returns, so flowpact can check your calls. It does not decide which commit runs: pin references to commit SHAs, or, for actions, use GitHub's [`actions.lock`](#githubs-actionslock), which flowpact reads. With it, flowpact checks remote calls as it checks local ones: - [`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101): a required input is not passed; - [`FP102`](https://ciatlas.github.io/flowpact/docs/rules/fp102): an input the workflow or action does not declare is passed; - [`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103): a literal of the wrong type is passed to a `boolean` or `number` input; - [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201): a required secret is not passed to a reusable workflow; - [`FP202`](https://ciatlas.github.io/flowpact/docs/rules/fp202): a secret it does not declare is passed; - [`FP205`](https://ciatlas.github.io/flowpact/docs/rules/fp205): a reusable workflow reads a secret it does not declare, and your call does not use `secrets: inherit`, so the secret is empty; - [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301): an output it does not declare is read. Only a composite action's outputs are checked: a JavaScript or Docker action may set others; - [`FP613`](https://ciatlas.github.io/flowpact/docs/rules/fp613): a job of a reusable workflow requests a `GITHUB_TOKEN` permission your call does not grant, so GitHub refuses the run when it starts. `flowpact remotes update` records them as `undeclaredSecrets`: only reads that run on every call. A read under an `if:` (on its step, its job, or a job its job needs) or in a condition is left out, since a caller's inputs, event or environment may switch it off. Not followed: a secret the remote workflow hands on with its own `secrets: inherit`, and `inherit` from a workflow of yours that was itself given secrets by name. `flowpact remotes update` records each job's own `permissions:` as `jobPermissions`, and the workflow's as `permissions` when a job has none of its own. A job of the remote workflow that calls another workflow without permissions hands on what it is granted to jobs flowpact does not read, so those are not checked. An entry written by flowpact 0.25 or earlier records neither until the next `remotes update`. What a remote workflow does with what it gets is not checked: its jobs are in another repository, so [`FP203`](https://ciatlas.github.io/flowpact/docs/rules/fp203), [`FP204`](https://ciatlas.github.io/flowpact/docs/rules/fp204) and [`FP106`](https://ciatlas.github.io/flowpact/docs/rules/fp106) stay quiet about it. Findings point at your call. Nothing is fetched during a run, so results do not depend on the network. In the editor, [hovering](https://ciatlas.github.io/flowpact/docs/editors#hover) a remote `uses:` value, or a key a remote call passes, shows the interface the lockfile records. ## Writing it [#writing-it] ```sh flowpact remotes update # every remote reference flowpact remotes update .github/workflows/release.yml # only what release.yml (and what it calls) uses ``` [`flowpact remotes update`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-remotes-update) resolves each remote reference to a commit, reads its workflow file or `action.yml` there through the GitHub API, and writes the lockfile. Commit it. Run it again when you move a reference to another version, or on a schedule to notice a tag that moved: it says what each changed entry does to your calls ([When a version changes](#when-a-version-changes)). It also keeps the files it reads in your [sources cache](#sources-for-the-editor), for the editor. `-v` logs a line per reference, with its commit or why it was not fetched. From a program, use [`remotesUpdate()`](https://ciatlas.github.io/flowpact/docs/api#remotesupdate-remotesdownload-and-remotesclean). ### Which token [#which-token] | Token | Read from | | --- | --- | | `GH_TOKEN` | first, when set | | `GITHUB_TOKEN` | when `GH_TOKEN` is not set | | the GitHub CLI's (`gh auth token --hostname `) | when neither is set, for the API's host | | none | public repositories only, at GitHub's 60 requests an hour for anonymous reads | Before fetching, flowpact says which API it reads and which token it uses, never the token itself: ```text GitHub API: https://api.github.com (github.com: GITHUB_API_URL is not set) token: `gh auth token --hostname github.com`, an OAuth token (GH_TOKEN and GITHUB_TOKEN are not set) ``` The token goes only to the GitHub API (`GITHUB_API_URL` on GitHub Enterprise Server). Public repositories need no permission. Private and internal ones need read access to their contents: a fine-grained token with **Contents: read**, a classic token with `repo`, or a GitHub App installation token that includes them. ### When a reference is not fetched [#when-a-reference-is-not-fetched] | Message | What to do | | --- | --- | | `not found, or not readable with this token` | The reference does not exist, or the token cannot read it. It is recorded under `unreadable:`; give a token that can read it to check it. | | `the GitHub API rejected the token (401)` | The token is invalid or expired, or for another host: check `GH_TOKEN` or `GITHUB_TOKEN`, or run `gh auth status`. | | `the GitHub API asks for a token (401)` | The API reads nothing without a token, as a GitHub Enterprise Server in private mode: set `GH_TOKEN`, or run `gh auth login --hostname `. | | `the GitHub API rate limit is used up` | Without a token GitHub allows 60 requests an hour: set a token, or wait. | | `the GitHub API asks to slow down` | GitHub's secondary rate limit, for many requests at once: try again when it says. | | `the GitHub API refused the request (403)` | The token lacks read access to that repository's contents. | | `could not reach https://api.github.com (…)` | Node's `fetch failed`: no network, DNS, TLS or a proxy. Check `GITHUB_API_URL`; behind a proxy, set `HTTPS_PROXY` with `NODE_USE_ENV_PROXY=1` (Node 24 and later), as Node's fetch ignores proxy variables otherwise. | | `no answer from … within 30 s` | The network or the API is slow: try again. | flowpact retries after no answer, a server error (5xx) or the secondary rate limit, three times at most and backing off (as long as the rate limit asks, up to a minute), and says why while it waits. Once a request cannot reach a host (no connection, or no answer) after its three attempts, the references left to read there fail at once, so an unreachable API costs one wait, not one per reference. It asks once more for a commit or file the API says is not there, which it now and then says of one it has. An invalid token, missing access and a used-up rate limit are not retried. When references cannot be fetched, the output ends with what to check: one hint per cause. When the API or the token may be the wrong one, it adds where to point flowpact. When `GITHUB_API_URL` is not set and the repository's `origin` is on another host, the hint names that host's API: ```text what to check: • some references are not on github.com, or not readable: this repository's origin is on gh.example.com: if that is a GitHub Enterprise Server or GHE.com, set GITHUB_API_URL=https://gh.example.com/api/v3; private and internal repositories need a token that can read their contents where flowpact reads remote repositories, and with which token: github.com GITHUB_API_URL not set token: GH_TOKEN, else `gh auth login` GitHub Enterprise Server GITHUB_API_URL=https://gh.example.com/api/v3 token: GH_TOKEN, else `gh auth login --hostname gh.example.com` GHE.com GITHUB_API_URL=https://api..ghe.com token: GH_TOKEN, else `gh auth login --hostname .ghe.com` ``` ## Sources for the editor [#sources-for-the-editor] The lockfile holds interfaces only. The files they come from go to a cache outside the repository, so the [editor](https://ciatlas.github.io/flowpact/docs/editors) can open them. `flowpact remotes update` keeps every file it reads there, and `flowpact remotes download` fills it for a lockfile someone else wrote, say after a `git pull`: ```sh flowpact remotes download # every remote reference the lockfile pins flowpact remotes download .github/workflows/release.yml # only what release.yml (and what it calls) uses ``` [`flowpact remotes download`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-remotes-download) reads each file at the commit the lockfile pins, so the editor shows the version the checks used. It resolves no tag, changes nothing in the lockfile, skips what the cache has, and needs the same [token](#which-token). | Platform | Cache | | --- | --- | | Linux and others | `$XDG_CACHE_HOME/flowpact/remotes`, or `~/.cache/flowpact/remotes` | | macOS | `~/Library/Caches/flowpact/remotes` | | Windows | `%LOCALAPPDATA%\flowpact\Cache\remotes` | `--cache-dir ` (relative to where you run flowpact) or `FLOWPACT_CACHE_DIR` (an absolute path) moves it to `/remotes`; point your editor at the same place ([Editors](https://ciatlas.github.io/flowpact/docs/editors)). Files are kept read-only, by host, repository and commit (`github.com/octo/ship//.github/workflows/deploy.yml`), as served. A file at a commit never changes, so nothing goes stale, one cache serves every repository on the machine, and you can delete any of it at any time. Older flowpact releases kept the files without the host (`octo/ship//…`). flowpact no longer reads, prunes or cleans those directories: delete them, or the whole `remotes` directory, and run `flowpact remotes download` to fill the cache again. After `remotes update` and `remotes download`, each repository in the cache keeps its 3 most recently used commits, and every commit the run used. The cache also stays under 128 MiB: past that, the least recently used commits go first, never one the run used. `flowpact remotes clean` empties the cache, and `flowpact remotes clean --keep 2` keeps 2 per repository. Cleaning removes only the `///` directories flowpact keeps, nothing else. Files of private and internal repositories land there too, readable by your user only: flowpact creates the cache's files and directories for you alone, wherever it is. A reference whose path could not be a file name on every platform (`..`, a character Windows rejects), or on a host given with a port, is not cached. Nobody opens the files in CI, so `remotes update` keeps none there unless `--cache-dir` or `FLOWPACT_CACHE_DIR` says where; the output says it kept none. CI is detected from `CI` (set by GitHub Actions, GitLab, CircleCI and most others), Azure Pipelines' `TF_BUILD` or Jenkins' `JENKINS_URL`. `remotes update --no-cache` keeps none anywhere. The action, `--fetch-remotes` and `--dry-run` never write the cache. Without a home directory and without either option, `remotes update` keeps nothing and `remotes download` stops with a usage error. ## GitHub Enterprise Server and GHE.com [#github-enterprise-server-and-ghecom] flowpact reads every remote reference from one API: `GITHUB_API_URL`, else `https://api.github.com`. It does not guess the host from the references. - **In CI**, the runner sets `GITHUB_API_URL` (`https:///api/v3` on GitHub Enterprise Server, `https://api..ghe.com` on GHE.com), so the action reads from your enterprise with `token`. - **On your machine**, set it yourself: `export GITHUB_API_URL=https:///api/v3`. The token is `GH_TOKEN`, `GITHUB_TOKEN`, or the GitHub CLI's for that host (`gh auth login --hostname `). A `GH_TOKEN` left over from github.com comes first, and the server rejects it: unset it, or set it to a token from the server. **Actions from github.com.** With GitHub Connect, a runner of GitHub Enterprise Server looks for an action on the enterprise server first, then on github.com. flowpact asks only the enterprise server unless you opt in, so an action the runner takes from github.com is recorded under `unreadable:`. To look on github.com too: ```sh flowpact remotes update --github-com # GITHUB_COM_TOKEN for github.com, or none ``` ```yaml - uses: ciatlas/flowpact@v0.29 with: remotes: fetch remotes-github-com: true github-com-token: ${{ secrets.GITHUB_COM_TOKEN }} # optional; public repositories need none ``` Entries read there are marked `host: github.com`. The enterprise token is never sent to github.com: `GITHUB_COM_TOKEN` (the action's `github-com-token`) is, or none. It is opt-in because it sends github.com the names of the references your enterprise server lacks, misspelled or deleted internal ones included. ## In CI [#in-ci] The [action](https://ciatlas.github.io/flowpact/docs/action) and the CLI read the committed lockfile and nothing else. To also check references it lacks, fetch them for the run. Nothing is written back, and the lockfile's own entries stand. ```yaml title=".github/workflows/flowpact.yml" - uses: ciatlas/flowpact@v0.29 with: remotes: fetch # token defaults to github.token ``` On the command line, `flowpact lint --fetch-remotes` (or `check`) does the same with the [token](#which-token) above. A reference that cannot be fetched is a warning and stays unchecked. `github.token` reads public repositories; private and internal ones need a token that can read them, such as a GitHub App installation token from `actions/create-github-app-token` with their names under `repositories:`. The action does not fetch on `pull_request_target` or `workflow_run`. There the workflows come from an untrusted pull request while the token may be privileged, so the pull request would choose which repositories the token reads. [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) warns when the lockfile lacks a reference the repository uses or has one nothing uses, even when the run fetched it: run `flowpact remotes update` and commit it. It also reports an entry for a reference pinned to a full commit SHA that records another commit. Such an entry was edited by hand and describes other code than what runs, so calls are not checked against it. ## When a version changes [#when-a-version-changes] A tag moves, or you move a reference to another version, and the new interface may drop an input you pass, make one required, or stop declaring an output you read. `flowpact remotes update` grades each changed entry against every call of its reference, before you commit the new lockfile (with `--dry-run`, before it writes anything): ```text would write .github/flowpact/remotes.lock.yaml token: GH_TOKEN changed actions/setup-node@v6: 2028fbc → 395ad32, breaks 1 of 3 calls input "always-auth" was removed — steps that pass it get a warning, and their value is ignored breaks .github/workflows/release.yml:21 jobs.publish step #2 FP102 actions/setup-node@v6 has no input "always-auth" 2 other calls fit ``` That one is real: setup-node 6.1.0 dropped `always-auth`, and `@v6` moved to it. Each call gets a verdict: | Verdict | Meaning | | --- | --- | | breaks | A check fails with the new interface that passed with the old one. The lines under it are what `flowpact check` reports once the lockfile is updated. | | not fully checked | No check fails, but part of the change is out of the checks' reach for this call; the line under it says which. | | fits | Every check passes as before. Only the calls that do not simply fit are listed. | The verdict comes from the rules above (FP101 to FP103, FP201, FP202, FP205, FP301 and FP613), run with the entry before and after. Problems a call already had do not count. A call is **not fully checked** when it: - passes an expression to an input the new version declares as `boolean` or `number`: only literals are checked ([`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103)); - uses `secrets: inherit`, and the new version needs a secret the old one did not: whether you have it is not known; - reads an output a JavaScript or Docker action no longer declares, which it can still set; - sets no `permissions:` (nor does its workflow, or every workflow that calls it), and the new version requests a permission at a higher level: whether the repository's default token permissions allow it is not known. A call that leaves out an input whose default changed gets a note: it runs with the new default. A runtime change (`runs.using`, such as `node20` to `node24`) is listed under the reference. The grade is about the interface, not the behaviour: read the release notes of a major version. ### A scheduled drift check [#a-scheduled-drift-check] To hear about a moved tag before a run fails, check on a schedule. `--fail-on breaks` fails the job when a changed entry breaks a call; `--fail-on unchecked` also when it leaves part of one unchecked: ```yaml title=".github/workflows/remotes-drift.yml" name: Remote interfaces drift on: schedule: - cron: '0 6 * * 1' workflow_dispatch: permissions: contents: read jobs: drift: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA with: persist-credentials: false - run: npx --yes flowpact@0.29 remotes update --dry-run --fail-on breaks env: GH_TOKEN: ${{ github.token }} ``` When a tag the lockfile records has moved to a commit that drops an input your workflow passes, the job fails with: Private and internal repositories need a token that can read them ([Which token](#which-token)). With `--format json`, a script gets the same as JSON: `grades` has one entry per changed reference, with its `verdict`, the interface `changes` and its `calls`. [`remotesUpdate()`](https://ciatlas.github.io/flowpact/docs/api#remotesupdate-remotesdownload-and-remotesclean) returns the same. ### On a pull request [#on-a-pull-request] With `remotes: fetch`, the [action](https://ciatlas.github.io/flowpact/docs/action) also grades the references a pull request moves to another version (`octo/setup@v2` → `@v3`) and adds a **Version changes** section to the job summary. The interface before is the base commit's; the one after is always fetched, never read from the pull request's own lockfile, which could hide a break. A version change that breaks a call fails the step (unless `fail-on` is `never`), and the `version-verdict` output says `breaks`, `unchecked` or `fits`. `flowpact lint --fetch-remotes` (or `check`) does the same on a pull request in GitHub Actions, or with `--base `, whose commit must be in the clone. It prints the grades after the report, or on stderr when the report is `json`, `sarif` or `github`, and exits `1` when one breaks a call, unless `--fail-on never`: ```text version changes from 5ea36fb: 1 call broken octo/setup@v3 (from octo/setup@v2): 3f2a9c1 → 9d4e2f1, breaks 1 of 1 call input "version" was removed — steps that pass it get a warning, and their value is ignored input "node-version" was added and must be passed — existing callers do not pass it breaks .github/workflows/ci.yml:6 jobs.b step #1 FP101 Step #1 uses octo/setup@v3 without required input "node-version" — GitHub will run it with an empty value FP102 octo/setup@v3 has no input "version" ``` Neither grades on `pull_request_target` or `workflow_run`. For your own action, [`lint()` and `check()`](https://ciatlas.github.io/flowpact/docs/api#version-changes) return the grades with `fetchRemotes`. ## Renovate and Dependabot [#renovate-and-dependabot] When Renovate or Dependabot moves a reference to another version (`octo/setup@v2` → `@v3`), the lockfile still has `@v2`. Until it is updated, `@v3` is checked only by a run that fetches it, and [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) says the lockfile is out of date. **Gate the bump.** With `remotes: fetch` in your flowpact job, the bot's pull request is [graded](#on-a-pull-request): the step fails when `@v3` breaks one of your calls, even when the pull request updates the lockfile too. Make the job a required status check, and Renovate's `automerge` and GitHub's auto-merge for Dependabot wait for it: ```yaml title=".github/workflows/flowpact.yml" on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA with: persist-credentials: false - uses: ciatlas/flowpact@v0.29 # pin to a commit SHA with: remotes: fetch ``` **Keep the lockfile current** in the bot's pull request, or update it after the merge (FP612 reminds you until then): Allow the command in the bot's admin config, not in `renovate.json` (`allowedCommands: ["^npx --yes flowpact@"]`, formerly `allowedPostUpgradeCommands`), and give it a token that can read the remote repositories through the environment Renovate runs commands in (for example `customEnvVariables`): ```json title="renovate.json" { "postUpgradeTasks": { "commands": ["npx --yes flowpact@0.29 remotes update"], "fileFilters": [".github/flowpact/remotes.lock.yaml"], "executionMode": "branch" } } ``` They run no commands of yours, so a workflow on their pull requests runs the update and pushes the lockfile to their branch. Push with a GitHub App token: pushes with `github.token` start no workflow runs, so the checks would not run again on the new commit. Dependabot's runs get a read-only token and only Dependabot secrets, so store the app's key as a Dependabot secret. ```yaml title=".github/workflows/remotes-lock.yml" name: Remote interfaces lockfile on: pull_request: paths: ['.github/workflows/**', '**/action.yml', '**/action.yaml'] permissions: {} jobs: update: if: contains(fromJSON('["renovate[bot]", "dependabot[bot]"]'), github.event.pull_request.user.login) runs-on: ubuntu-latest steps: - id: app uses: actions/create-github-app-token@v3 # pin to a commit SHA with: client-id: ${{ vars.LOCK_BOT_CLIENT_ID }} private-key: ${{ secrets.LOCK_BOT_PRIVATE_KEY }} - uses: actions/checkout@v7 # pin to a commit SHA with: ref: ${{ github.head_ref }} token: ${{ steps.app.outputs.token }} persist-credentials: true - run: npx --yes flowpact@0.29 remotes update env: GH_TOKEN: ${{ steps.app.outputs.token }} - run: | git diff --quiet -- .github/flowpact/remotes.lock.yaml && exit 0 git config user.name 'remotes-lock[bot]' git config user.email 'remotes-lock[bot]@users.noreply.github.com' git commit -m 'chore: update the remote interfaces lockfile' -- .github/flowpact/remotes.lock.yaml git push ``` The job runs only for the bots' pull requests, checks out their branch (never a fork's: bots push to your repository), and runs `flowpact` from npm, not code from the pull request. ## GitHub's actions.lock [#githubs-actionslock] GitHub's [workflow dependency lockfile](https://docs.github.com/actions/concepts/security/workflow-dependency-lockfiles), `.github/workflows/actions.lock` (written by `gh actions-lock` and Dependabot; Renovate's support is experimental), pins the commit each action `owner/repo@ref` runs in the workflows it covers: a tag such as `@v4` keeps running that commit after it moves. The two files do different jobs: | | `.github/workflows/actions.lock` | `.github/flowpact/remotes.lock.yaml` | | --- | --- | --- | | Written by | `gh actions-lock`, Dependabot, Renovate (experimental) | `flowpact remotes update` | | Records | the commit each action runs, and who owns it | each reference's inputs, secrets and outputs at a commit | | Used by | the runner, which runs that commit and checks it | flowpact, which checks your calls against the interface | flowpact reads `actions.lock` and never writes or verifies it: run `gh actions-lock --verify` in CI for that. `remotes update`, `--fetch-remotes`, the action's `remotes: fetch` and the [pull request grading](#on-a-pull-request) read each action it pins at the pinned commit, not where its tag points now, and `remotes update` says how many it read that way. When flowpact's lockfile records another commit, [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) reports it: the bot that updated `actions.lock` left `remotes.lock.yaml` as it was, so run `flowpact remotes update`. - Only the workflows `actions.lock` lists are covered. An action used by a covered and an uncovered workflow is read at the pinned commit. - An action with a path (`actions/cache/restore@v4`) is pinned by its repository's key (`actions/cache@v4`), as `gh actions-lock` writes it. - GitHub does not lock reusable workflow calls (`jobs..uses`, [gh-actions-lock#179](https://github.com/github/gh-actions-lock/issues/179)), so flowpact reads them where their ref points now, even when an action of the same repository and ref is pinned. Pin them to a commit SHA to choose what runs. - Onboarding a workflow with `gh actions-lock` can rewrite its references (`@v4` to `@v4.2.1`, or a SHA to its tag): run `flowpact remotes update` after it, or FP612 reports the new references. - The schema is before 1.0: flowpact reads versions `v0.0.x`, v0.0.1's keys included. Another version, or a file that does not parse, is not used: [`FP614`](https://ciatlas.github.io/flowpact/docs/rules/fp614) reports it, and `remotes update` says why. Its `hostname` is not read. ## The lockfile [#the-lockfile] `.github/flowpact/remotes.lock.yaml` (or `remotes.lock.yml`), one entry per `uses:` reference: ```yaml title=".github/flowpact/remotes.lock.yaml" version: 1 remotes: octo/ship/.github/workflows/deploy.yml@v1: sha: 4e6c5f0b9a1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f # the commit v1 resolved to kind: workflow inputs: env: { type: string, required: true } dry-run: { type: boolean, default: false } secrets: token: { required: true } outputs: [url] undeclaredSecrets: [NPM_TOKEN] # read without being declared: only secrets: inherit gives it permissions: { contents: read } # the workflow's, for its jobs without their own jobPermissions: release: { contents: write } # a job's own octo/setup@v2: sha: 9f8e7d6c5b4a39281706f5e4d3c2b1a098765432 kind: action using: composite # runs.using; outputs are checked only for composite inputs: version: { required: true } outputs: [path] ``` Two versions of one action (`octo/setup@v1` in one job, `@v2` in another) are two entries, and each call is checked against its own. A reference that `flowpact remotes update` cannot read (it does not exist, or the token cannot read it) is recorded under `unreadable:`, with why. It is not checked, but the lockfile accounts for it, so [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) does not report it: ```yaml unreadable: vercel/gh-sts-action@c30f0b7a16e0766c4ffbc0d210b54d0e75053fd2: not found, or not readable with this token ``` The owner and repository of a reference match in any letter case, the path and the ref as written. A reference the lockfile does not have stays unchecked. A lockfile that does not parse or does not match this shape is reported by [`FP611`](https://ciatlas.github.io/flowpact/docs/rules/fp611), and then no remote call is checked. # Roadmap (https://ciatlas.github.io/flowpact/docs/roadmap) What each release changed is in the [changelog](https://ciatlas.github.io/flowpact/docs/changelog). ## Shipped [#shipped] ### Lint [#lint] - **Data-flow engine:** workflows, local composite actions, nested reusable workflows and same-repository references, followed across files. - **Exact matrix expansion**, with each combination evaluated on its own, and declared shapes for matrices computed at run time ([`matrixShapes`](https://ciatlas.github.io/flowpact/docs/configuration#matrix-shapes)). - **55 [rules](https://ciatlas.github.io/flowpact/docs/rules)** (`FP1xx`–`FP9xx`) with stable codes, a page each and `flowpact explain`. - **[Overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)** with a mandatory reason, an optional expiry date and owner. Expired, unused and soon-expiring overrides are reported (`FP901`–`FP903`). - **[Ignore comments](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments)** that accept a finding on its line (`# flowpact: ignore[FP501] why`), also after a pinned action's version comment. Invalid and unused ones are reported (`FP904`, `FP905`). - **[Plugins](https://ciatlas.github.io/flowpact/docs/custom-rules):** an organization's own rules, loaded from the config. ### Where it runs [#where-it-runs] - **CLI:** `lint`, `check`, `impact`, `generate`, `remotes`, `graph` (tree, Mermaid, DOT, JSON), `trace`, `explain`, `rules` and `lsp`. Pretty, JSON, Markdown and SARIF output. - **[GitHub Action](https://ciatlas.github.io/flowpact/docs/action):** a job summary, pull request annotations, SARIF, and the regenerated contracts as an artifact. - **[Language server](https://ciatlas.github.io/flowpact/docs/editors)** (`flowpact lsp`): findings as you type across files, hover traces, go to definition across workflow calls, and references, a step's own `env` and step ids included. Calls into other repositories are described from the remote interfaces lockfile, and go to definition opens their cached sources. [Quick fixes](https://ciatlas.github.io/flowpact/docs/editors#quick-fixes) rename a misspelled name, add a missing input, secret or matrix key, remove an unused input, regenerate the contracts, and accept a finding with an override or an ignore comment. Contract files have hover and go to definition too. [Rename](https://ciatlas.github.io/flowpact/docs/editors#rename) an input, secret or output across its declaration, its callers and its reads. [Completion](https://ciatlas.github.io/flowpact/docs/editors#completion) offers the inputs and secrets a call does not pass yet, from the lockfile for calls into other repositories. - **[VS Code extension](https://ciatlas.github.io/flowpact/docs/editors#vs-code)** on the Visual Studio Marketplace and Open VSX, with the language server bundled. - **[API](https://ciatlas.github.io/flowpact/docs/api)**: every command as a function, for scripts and your own actions. - Published JSON Schemas for the config file, the contracts and the reports. ### Shared workflows [#shared-workflows] - **[Contracts](https://ciatlas.github.io/flowpact/docs/contracts):** `flowpact generate` writes a lockfile per published workflow and action, and `flowpact check` reports missing, outdated, orphaned and invalid contracts and breaking interface changes (`FP801`–`FP805`), with a patch for anyone who cannot run the CLI. - **[Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode):** the release a pull request declares (its Conventional Commits title, labels or release version) is checked against what its changes require, including the check names that branch protection depends on (`FP810`–`FP814`). - **[Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces):** `flowpact remotes update` records the interfaces of the workflows and actions you call in other repositories, and calls into them are checked like local ones. On GitHub Enterprise Server and GHE.com too, with an opt-in look on github.com as GitHub Connect does. GitHub's own [`actions.lock`](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock) decides which commit of an action is read (GitHub does not lock reusable workflow calls). - **[Version changes, graded against your calls](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes):** when a reference moves to another version, each of your calls is graded as broken, unchecked or still fitting: in a scheduled drift check, and on the pull request that moves it. ## Next [#next] The editor plan is complete. Ask for what you need next in [GitHub issues](https://github.com/ciatlas/flowpact/issues); what each release brings is in the [changelog](https://ciatlas.github.io/flowpact/docs/changelog). # Shared workflows (https://ciatlas.github.io/flowpact/docs/shared-workflows) A reusable workflow or action that other repositories call is an interface: its inputs, secrets and outputs, and the check names its jobs report. The repositories that call it pin a tag such as `@v2` and take every release in it, and you cannot see their workflows or their branch protection. flowpact checks both sides of that interface. ```mermaid flowchart TD accTitle: Publishing and using shared workflows subgraph pub["org/ci-templates · publishes"] C["contracts and impact mode"] end T["release v2.1.0 · tag v2"] subgraph app["org/app · uses"] L["remotes.lock.yaml and lint"] end C -->|"graded: minor"| T T -->|"remotes update"| L ``` ## When you publish [#when-you-publish] A **published** workflow or action is one other repositories can use: every reusable workflow but those whose file name starts with `_`, and the action at the repository's root (see [Concepts](https://ciatlas.github.io/flowpact/docs/concepts#published-unit)). A contract per workflow and action records its interface. A change to it shows as a YAML diff in review, and `flowpact check` fails on a breaking one. Impact mode grades a pull request's changes as major, minor, patch or none, and fails it when its title declares less. In the GitHub Action, both are inputs: ```yaml title=".github/workflows/flowpact.yml" on: pull_request: # edited / labeled: grade again when the title or the labels change types: [opened, edited, synchronize, reopened, labeled, unlabeled] permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA - uses: ciatlas/flowpact@v0.29 # pin to a commit SHA with: mode: check # lint, and compare with the committed contracts impact: auto # grade the change against the pull request title ``` ## When you use them [#when-you-use-them] Record the interfaces of the workflows and actions you call in a lockfile, and every call is checked against them, with no network during the run. A drift check on a schedule, and a verdict on each pull request that moves a reference to another version. ```sh npx flowpact remotes update # record the interfaces, then commit the lockfile npx flowpact remotes update --dry-run --fail-on breaks # on a schedule: what changed, and what it breaks ``` ## Across an organization [#across-an-organization] [Roll it out across an organization](https://ciatlas.github.io/flowpact/docs/integrating): organization defaults in a base config, organization rules as plugins, and the action wrapped in one of your own. # Follow a value (https://ciatlas.github.io/flowpact/docs/tracing) A value can pass through several files before it is used: a caller's matrix, a reusable workflow's input, an action's input, and then a script or an `if:`. `flowpact trace` follows it in either direction, all the way, and the editor shows each step as you hover. The examples on this page run on flowpact's [fixtures](https://github.com/ciatlas/flowpact/tree/main/fixtures). ## Where does this value go? [#where-does-this-value-go] ```sh npx flowpact trace pipeline.yml:environment ``` ```text .github/workflows/pipeline.yml#inputs.environment:5:7 (input) └── ▶ .github/workflows/build.yml#inputs.environment:5:7 (input) via ${{ inputs.environment }} @ .github/workflows/pipeline.yml:23:24 └── ▶ .github/workflows/package.yml#inputs.environment:5:7 (input) via ${{ inputs.environment }} @ .github/workflows/build.yml:31:24 └── ▶ .github/workflows/publish.yml#inputs.environment:5:7 (input) via ${{ inputs.environment }} @ .github/workflows/package.yml:27:24 └── job setting in jobs.upload › environment .github/workflows/publish.yml:24:22 ${{ inputs.environment }} ``` Each `▶` is an input, secret or output the value is passed on to, and `via` is the expression that passes it, at the line that does. The trace ends where the value is used: here a job's `environment:`, three reusable workflows down. Elsewhere it ends at a script (`run script`), a condition (`condition`) or an action's input. ## Where does it come from? [#where-does-it-come-from] `--up` follows a value back to where it starts. In the [`incident-matrix`](https://github.com/ciatlas/flowpact/tree/main/fixtures/incident-matrix) fixture, a test suite's `config` input comes from a matrix: ```sh npx flowpact trace run-suite.yml:config --up ``` ```text .github/workflows/run-suite.yml#inputs.config:11:7 (input) └── ◀ .github/workflows/tests.yml#jobs.run.matrix.config:15:13 (matrix) via ${{ matrix.config }} @ .github/workflows/tests.yml:23:19 ├── value in { name: linux } .github/workflows/tests.yml:12:7 │ "ci-linux.json" ├── value in { name: macos } .github/workflows/tests.yml:12:7 │ "ci-macos.json" └── missing in { name: windows } .github/workflows/tests.yml:12:7 (undefined → '') ``` The windows combination does not define `config`, so the input is empty there. Downstream, the same input decides whether the tests run at all: ```text $ npx flowpact trace run-suite.yml:config .github/workflows/run-suite.yml#inputs.config:11:7 (input) ├── condition in jobs.test › if .github/workflows/run-suite.yml:17:9 │ inputs.config != '' └── run script in jobs.test › steps[1] › run .github/workflows/run-suite.yml:21:107 ./run-tests.sh --suite "${{ inputs.suite }}" --variant "${{ inputs.variant }}... ``` On windows the job is skipped, and the run stays green. `flowpact lint` reports it as [`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401); the trace shows why. Each branch upstream ends at what the value is: a `literal`, an input a caller leaves out (`omitted`, with the default GitHub then uses), a matrix `value` or a `missing` one, or a `context` flowpact does not follow. The [`flowpact trace` reference](https://ciatlas.github.io/flowpact/docs/cli#flowpact-trace) lists them all, with inputs' defaults, dispatch inputs and `toJSON(inputs)`. ## Where outside data enters [#where-outside-data-enters] A `context` leaf is where a value enters from outside the files: the event (`github.event.pull_request.title`), the runner, a step's outcome, or an `env` variable a script sets at run time. Here a reusable workflow's input carries a pull request's title, text its author controls, while another caller passes its own input and the branch or tag it runs on: ```text $ flowpact trace notify.yml:message --up .github/workflows/notify.yml#inputs.message:4:7 (input) ├── ◀ .github/workflows/release.yml#inputs.version:4:7 (input) │ via Released ${{ inputs.version }} from ${{ github.ref_name }} @ .github/workflows/release.yml:9:29 ├── context in .github/workflows/pr.yml › jobs.notify .github/workflows/pr.yml:6:20 │ github.event.pull_request.title └── context in .github/workflows/release.yml › jobs.notify .github/workflows/release.yml:9:56 github.ref_name ``` flowpact does not judge whether such a value is safe where it is used. [zizmor](https://github.com/zizmorcore/zizmor) reports expressions expanded into scripts (template injection); pass them through `env:` instead. ## Name a value [#name-a-value] | Query | Matches | | --- | --- | | `ci.yml:env` | the inputs, secrets or outputs named `env` | | `ci.yml` | the whole interface of the workflow: every input, secret and output | | `ci.yml#inputs.env` | that input, by file name | | `.github/workflows/ci.yml#inputs.env` | that input, by path | | `setup:token` | an input of the local action in `.github/actions/setup` | A symbol is shown once per trace: when the value reaches it again by another path, the tree says `↑ shown above`. `--depth n` stops after `n` levels (12 by default). ## In the editor [#in-the-editor] The [editor extension](https://ciatlas.github.io/flowpact/docs/editors) shows the same flow one step at a time. **Hover** an input, secret, output, env variable or matrix key for where its value comes from and where it goes; **go to definition** jumps from a caller's `with:` key to the callee's input, or from `needs.build.outputs.url` to the output; **Find All References** lists every read and every caller that passes it. ## Which workflows call which [#which-workflows-call-which] ```sh npx flowpact graph ``` ```text Pipeline (.github/workflows/pipeline.yml) · on: workflow_dispatch └── jobs.build (inherit) → Build (.github/workflows/build.yml) └── jobs.package → Package (.github/workflows/package.yml) └── jobs.publish → Publish (.github/workflows/publish.yml) ``` `(inherit)` marks a call with `secrets: inherit`, and `×N` one that fans out over `N` matrix combinations. `--format mermaid` draws the same graph as a diagram GitHub renders in Markdown, issues and pull requests: ../../generated/deep-nesting.mmd `dot` and `json` are for other tools ([`flowpact graph`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-graph)). ## In scripts [#in-scripts] `--format json` prints the traces for tools, and the [API](https://ciatlas.github.io/flowpact/docs/api#graph-trace-rules-and-explain) has `trace()` and `graph()` for programs. ## How values are followed [#how-values-are-followed] When a caller or step omits an input, its `default:` is the value there, so the trace also ends at the default (its leaves come after the callers' leaves; the symbols it reads are `◀` branches, which come first): a `literal` for a plain default, or what an expression default reads, at ` › inputs..default` (` › on.workflow_call.inputs..default` in a reusable workflow). GitHub evaluates a default with a few contexts only: - a reusable workflow's input: `github`, `inputs` and `vars`. The default applies when the workflow is called, so the `workflow_call` inputs and the variables it names (`inputs.`, `vars.`) are followed as `◀` branches, noted `(the default of inputs.)`; a whole `inputs` (`toJSON(inputs)`) is a branch for each `workflow_call` input. An input declared only under `workflow_dispatch` (or nowhere) is empty there, a whole `vars` (`vars.*`) names no single variable, and `github` is the caller's, so `github.event.inputs.` is not the workflow's own input: each is a `context` leaf; - an action's input: the calling job's `github`, `strategy`, `matrix`, `job` and `runner`, each a `context` leaf. It may also call `hashFiles()`, which reads no context: `${{ hashFiles('**/package-lock.json') }}` alone ends at an `expression` leaf. Any other context in a default (`env`, `secrets`, `steps`, `needs`, or an action's `inputs` and `vars`) is an `invalid` leaf, as is a status function such as `success()`, or `hashFiles()` in a reusable workflow's default. A default that no caller falls back to is not shown, nor is the default of a required reusable-workflow input: GitHub fails the run when a caller omits it ([`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101)). Here a local action's `token` defaults to `github.token`, and neither step that uses the action passes it: ```text $ flowpact trace setup:token --up .github/actions/setup#inputs.token .github/actions/setup/action.yml:4:3 (input) ├── omitted in .github/workflows/ci.yml › jobs.build › steps[1] .github/workflows/ci.yml:8:15 │ (not passed) ├── omitted in .github/workflows/ci.yml › jobs.test › steps[1] .github/workflows/ci.yml:13:15 │ (not passed) └── context in .github/actions/setup › inputs.token.default .github/actions/setup/action.yml:4:65 github.token ``` A workflow that can be both called and dispatched holds an input in `github.event.inputs.` only when it is dispatched. When it is called, GitHub gives it the caller's `github` context, so `github.event.inputs` is the caller's event, never what the caller passes in `with:`. Upstream, such a read shows the input as a branch noted `(when dispatched)`, with nothing traced under it, next to a `context` leaf for the called case; downstream, an input reached through a caller's `with:` does not go on through its `github.event.inputs` reads. The same holds for a whole or computed `github` (`toJSON(github)`, `github.event[x]`), which reads every dispatch input, and for the step's own `env:` values that read `github`. Read it as `inputs.`, which holds the value in both cases. Here `release.yml` calls `deploy.yml` with `environment: production`, a value that never reaches the action: ```text $ flowpact trace ship:environment --up .github/actions/ship#inputs.environment .github/actions/ship/action.yml:4:3 (input) ├── ◀ .github/workflows/deploy.yml#inputs.environment:4:7 (input) │ via ${{ github.event.inputs.environment }} (when dispatched) @ .github/workflows/deploy.yml:16:28 └── context in .github/workflows/deploy.yml › jobs.deploy › steps[1] .github/workflows/deploy.yml:16:28 github.event.inputs.environment ``` A whole object or a computed key reads every member: `toJSON(inputs)`, `inputs[inputs.which]`, `toJSON(matrix)`, `secrets[inputs.name]` and `toJSON(env)` are a `◀` branch for each input, matrix key, secret or env variable the files declare, and downstream a use of each. A whole `secrets` is also a `◀` branch for each secret the workflow reads by name or is passed by name, and for `GITHUB_TOKEN`, which every workflow has. A workflow that callers hand every secret to through `secrets: inherit` gets every secret they have, so there a whole `secrets` is also a `◀` branch for each secret those callers declare, read by name or are passed by name, and downstream a caller's secret goes through `secrets: inherit` into it, as into a workflow that may read every secret: one with an expression that does not parse, or that hands every secret on to a remote workflow. Secret names ignore case, so `secrets: inherit` follows a secret to the other workflow's own spelling of it: the one it declares, else each spelling it reads or a caller passes it by. It never hands on `GITHUB_TOKEN`, which GitHub gives every workflow itself. Where the object can hold members the files do not declare, it also stays a `context` leaf: `env` (written at runtime), `secrets` (secrets no file names, and through `secrets: inherit` the callers'), an action's `inputs` (the runner passes every `with:` key) and a matrix computed at runtime, in whole or in its `include`. Variables are set in the repository's settings, so a whole `vars` is only a `context` leaf. Here a reusable workflow passes all its inputs to an action, and the caller omits `profile`: ```text $ flowpact trace report:settings --up .github/actions/report#inputs.settings .github/actions/report/action.yml:4:3 (input) ├── ◀ .github/workflows/build.yml#inputs.target:4:7 (input) │ via ${{ toJSON(inputs) }} @ .github/workflows/build.yml:14:32 │ └── literal in .github/workflows/ci.yml › jobs.build .github/workflows/ci.yml:7:15 │ "linux" └── ◀ .github/workflows/build.yml#inputs.profile:5:7 (input) via ${{ toJSON(inputs) }} @ .github/workflows/build.yml:14:32 ├── omitted in .github/workflows/ci.yml › jobs.build .github/workflows/ci.yml:5:11 │ (not passed) └── literal in .github/workflows/build.yml › on.workflow_call.inputs.profile.default .github/workflows/build.yml:5:41 "release" ``` # Troubleshooting (https://ciatlas.github.io/flowpact/docs/troubleshooting) Find what you see below. Each answer has a link you can share (the icon beside its title). For anything not listed, [run with debug logging](#still-stuck). ## Running flowpact [#running-flowpact] flowpact analyzes the repository in the current directory, and found neither a workflow under `.github/workflows` nor a local action there. It exits with code `2`. Run it at the root of the repository, or point at it: ```sh npx flowpact lint --root path/to/repository ``` That is common on a large repository, and it does not mean they are all urgent. [Adopt it in an existing repository](https://ciatlas.github.io/flowpact/docs/adopting) says where to start: fix the errors first, accept what can wait with a reason and a date, and keep new findings out from then on. Accept that one finding with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides): it names the rule and the symbol or file, and needs a reason, which stays next to it in the repository. Add `expires` to see it again on a date. A rule's page shows the override that accepts its finding, under **Accept one finding**. To change a rule everywhere, set its severity under `rules:` instead ([Change a rule that does not fit](https://ciatlas.github.io/flowpact/docs/adopting#change-a-rule-that-does-not-fit)). Plugins run code from the repository, so they are skipped: - by the CLI with `--no-plugins`; - by the GitHub Action on `pull_request_target` and `workflow_run`, unless its `plugins` input is `true`; - by the editor in an untrusted workspace (Restricted Mode), or with `flowpact.plugins` off. The run warns about the `rules:` and `overrides:` entries of rules it did not load ([Rules that are not loaded](https://ciatlas.github.io/flowpact/docs/configuration#rules-that-are-not-loaded)). In the editor, run **flowpact: Restart Language Server** after you edit a plugin: a loaded plugin stays loaded. ## In the editor [#in-the-editor] - The extension starts its server when the workspace has workflows or an `action.yml`, or when you open one. - A file is analyzed with its repository: the nearest folder above it with a `.github` folder, else the root of its git repository. A file in neither gets no findings. - A rule may be hidden: by `flowpact.hiddenRules`, or, for `FP502`–`FP505`, by `flowpact.overlappingRules` while GitHub's own Actions extension checks the file ([Settings](https://ciatlas.github.io/flowpact/docs/editors#settings)). The **flowpact** output channel (**flowpact: Show Output**) and the language status item next to the file type show the server's state. Set the log level to Debug (**Developer: Set Log Level…**) to see each stage of the analysis. ## In GitHub Actions [#in-github-actions] The workflow has a `paths:` filter, and the pull request touches none of those paths: GitHub skips the workflow and leaves a required check pending, so the pull request cannot merge. Run a required check on every pull request ([No paths filter on a required check](https://ciatlas.github.io/flowpact/docs/ci#the-flowpact-action)). When other repositories' pull requests wait on a check of a workflow you publish, a job was probably renamed: [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) grades that change as major. GitHub limits how many annotations a step can show. The job summary lists the first `max-findings` findings (raise it if needed); the SARIF and JSON reports list every finding ([Annotations](https://ciatlas.github.io/flowpact/docs/action#annotations)). Pull requests from forks get a read-only token, so the SARIF upload only works for branches in the repository itself. The job that uploads needs `security-events: write`, and `actions: read` in a private repository ([Permissions](https://ciatlas.github.io/flowpact/docs/action#permissions)). - **On GitHub Enterprise Server**, actions cannot upload artifacts this way. Set `upload-contracts: false`: the patch is still written, and the `patch` output has its path on the runner. - **Already exists:** another step or matrix job in the run uploaded an artifact with the same name. Give each one its own `artifact-name`. The run goes on either way: the failure is a warning. A message such as `origin/main is not available in this clone. Fetch it first` comes from the CLI on a shallow checkout: fetch the baseline (`git fetch origin main`), or check out with `fetch-depth: 0`. The action fetches the base commit itself. Impact mode is skipped, and says why, on `merge_group` runs (the pull request was graded), on a push that creates a branch or tag, and when the baseline is the checked-out commit. Without `base-ref`, it refuses `pull_request_target`, which checks out the default branch: run it on `pull_request` ([The baseline](https://ciatlas.github.io/flowpact/docs/impact-mode#the-baseline)). ## Calls into other repositories [#calls-into-other-repositories] flowpact does not know those workflows' interfaces yet. Record them, and commit the lockfile: ```sh npx flowpact remotes update ``` From then on, those calls are checked like local ones. To check them in CI without a lockfile, set `remotes: fetch` on the action ([In CI](https://ciatlas.github.io/flowpact/docs/remote-interfaces#in-ci)). The bot moved a reference to another version (`@v2` → `@v3`), and the lockfile still records the old one. Run `flowpact remotes update` in the bot's pull request, or let the action grade it: see [Renovate and Dependabot](https://ciatlas.github.io/flowpact/docs/remote-interfaces#renovate-and-dependabot) for both setups. The message says why: a token that cannot read the repository, a used-up rate limit, the network. [When a reference is not fetched](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-reference-is-not-fetched) lists each message and what to do. flowpact already sends a request again after a timeout, a server error or GitHub's request to slow down. Run with `-v` for a line per reference, with the commit it resolved to or why it was not fetched. No check fails with the new version, but part of the change is out of the checks' reach for that call: an expression passed to an input that is now a `boolean` or `number`, a new secret under `secrets: inherit`, or an output of a JavaScript or Docker action that is no longer declared. The line under the call says which; read the release notes for that part ([When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes)). [`FP614`](https://ciatlas.github.io/flowpact/docs/rules/fp614) says why when flowpact cannot use the file, and so does `remotes update`: flowpact reads versions `v0.0.x` of its schema, and a file that does not parse is not used. It covers only the workflows it lists: a reference that only other workflows use resolves as usual, and so does a reusable workflow call, which GitHub does not lock ([GitHub's actions.lock](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock)). ## Shared workflows [#shared-workflows] Do not merge contract files by hand. Resolve the conflicts in the workflow files, then regenerate: `flowpact generate` overwrites the conflicted contracts, conflict markers and all ([Merge conflicts](https://ciatlas.github.io/flowpact/docs/contracts#merge-conflicts)). ```sh npx flowpact generate git add .github/flowpact/ ``` ## Still stuck [#still-stuck] Run with debug logging. It logs every stage of the analysis to stderr: the config, the files, each job's matrix, and each rule with its findings ([Debug mode and logging](https://ciatlas.github.io/flowpact/docs/cli#debug-mode-and-logging)). | Where | How | | --- | --- | | Terminal | `npx flowpact lint --debug` | | GitHub Actions | Re-run the job with debug logging, or set `FLOWPACT_DEBUG: 1` in the step's `env` | | Editor | **Developer: Set Log Level…** → Debug, then **flowpact: Show Output** | Exit code `3` is an internal error: please [open an issue](https://github.com/ciatlas/flowpact/issues) with the debug output. To report a vulnerability, see [Security](https://ciatlas.github.io/flowpact/docs/security). # Upgrading (https://ciatlas.github.io/flowpact/docs/upgrading) A minor release can change what is reported. An incompatible change to the CLI, the configuration, the action, the reports or the API is a major release (the next one is 1.0.0); up to 0.14, a minor release could make one too. ## Move to a new version [#move-to-a-new-version] - **GitHub Action:** `uses: ciatlas/flowpact@v0.` with the new minor version. Before 1.0 the floating tag follows a minor release, so `@v0.22` stays on 0.22. - **CLI:** `npx flowpact@0.`, or update the dev dependency. - **VS Code:** the extension updates itself. Then read the sections below from your version up. ## 0.29.0 → 0.29.1 [#0290--0291] Run `flowpact remotes download` once in each repository whose remote sources you open in the editor. The [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor) now keeps each file under its host (`github.com/octo/ship//…`), and flowpact no longer reads the files earlier releases kept: go to definition on a remote reference finds nothing until the cache has it again. Delete the old `` directories in it, or the whole `remotes` directory. `remotes update` now also reads a file the cache has instead of asking the API for it. ## 0.26 → 0.29 [#026--029] Remove the overrides and ignore comments that [FP902](https://ciatlas.github.io/flowpact/docs/rules/fp902) and [FP905](https://ciatlas.github.io/flowpact/docs/rules/fp905) report after the upgrade. What is new: - **[FP105](https://ciatlas.github.io/flowpact/docs/rules/fp105) leaves out skips the workflow expects:** a step whose results are only read through a fallback that is not empty when the step is skipped (`steps.token.outputs.token || github.token`), in a condition that asks whether it ran or that is true when it was skipped (as a whole, or in the `&&` or `||` operand that reads it, taken with the `!`s around it), or through a job output read that way. Nor does it report a condition with text around `${{ }}`, which is always true, or one that leaving out the input cannot turn false (`inputs.x || 'yes'`, `!inputs.x`). Overrides and ignore comments that accepted those findings now match nothing, and FP902 and FP905 (warnings) report them. A finding whose message named another input of the same condition that is no longer reported loses that note, which changes its fingerprint. - **New findings: FP105 and [FP107](https://ciatlas.github.io/flowpact/docs/rules/fp107) treat `default: ''` as no default**, since GitHub passes '' for an omitted input anyway. An input whose default is '' (`default: ''`, `default: ${{ '' }}`) is reported where one without a default is: make it `required: true` or give it a non-empty default, or, if skipping is intended, say so in the condition (`inputs.x != ''`). - **New findings: a new rule, [FP506](https://ciatlas.github.io/flowpact/docs/rules/fp506),** reports a value read as a boolean that can be another string. It is an error for `fromJSON()` of a value that may be '' (an optional input without a default, or the output of a step whose `if:` can skip it), or that may be other text in `continue-on-error:`, which fails the job, and a warning for a comparison with `'true'` or `'false'` of a value that can be other text, or for an `||` under `env:`, `with:` or `outputs:` that gives a boolean or text (`a == 'b' || inputs.file`). The editor offers `!= ''` where the value is set as a quick fix. - **A new rule, [FP507](https://ciatlas.github.io/flowpact/docs/rules/fp507), off by default:** a condition that compares a value with `''` (`x != ''`, `x == ''`), which an `if:` already does by itself. Turn it on with `FP507: info`: the editor then fades the comparison and removes it in a quick fix (`x`, `!x`). It reports nothing under `env:`, `with:`, `outputs:` or `continue-on-error:`, where the comparison is what makes the value `true` or `false`. - **GitHub's [`actions.lock`](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock) pins actions only:** a reusable workflow call is read where its ref points, as GitHub runs it, even when an action of the same repository and ref is pinned. [FP612](https://ciatlas.github.io/flowpact/docs/rules/fp612) no longer reports such a call's entry as recording another commit than `actions.lock`, and the first `remotes update` may list it as `changed`. A v0.0.1 `actions.lock` is now read. - **A new warning, [FP614](https://ciatlas.github.io/flowpact/docs/rules/fp614):** flowpact cannot read `actions.lock` (a schema version after `v0.0.x`, or a file that does not parse), so it checks remote actions where their ref points now, not at the commit GitHub runs. Before, only `remotes update` said so. A repository without the file, or with one flowpact reads, gets none. - **Editor:** [hovering](https://ciatlas.github.io/flowpact/docs/editors#hover) an expression away from a symbol says whether GitHub reads it as a condition or a value and what it yields, and a step output's hover says when it may be `''`. ## 0.25 → 0.26 [#025--026] Nothing to change. What is new: - **A new error, [FP613](https://ciatlas.github.io/flowpact/docs/rules/fp613):** a job of a called workflow requests a `GITHUB_TOKEN` permission the call does not grant, which GitHub refuses when the run starts. A call that sets no `permissions:`, in its job or its workflow, is not checked: it gets the repository's default. The editor offers a quick fix that raises the grant. - **Remote interfaces lockfile:** `flowpact remotes update` now records what a remote reusable workflow's jobs request (`permissions`, `jobPermissions`), and FP613 checks your calls of it too. The first `remotes update` lists those entries as `changed`, though their commits are the same, and grades no call on what they now record. flowpact 0.21 and later ignore keys a later version adds, so an older pin of the action or the CLI keeps reading the lockfile. - **From 0.26.1, impact mode's own rules are judged by the baseline:** the severities and overrides of FP810–FP814 come from the baseline's config, like the impact policy. A pull request that turns one off or accepts its finding in its own config is still graded, with a note that the change applies once merged, and an ignore comment naming one is invalid ([FP904](https://ciatlas.github.io/flowpact/docs/rules/fp904)). Settings already on the base branch keep working. ## 0.24 → 0.25 [#024--025] Nothing to change. What is new: - **[Ignore comments](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments):** `# flowpact: ignore[FP501] why` accepts a finding on its line, or alone on the line above it, also after a pinned action's version comment. The editor offers it as a quick fix. Accepted findings are listed under `ignoredByComment` in the [JSON report](https://ciatlas.github.io/flowpact/docs/cli#json-report) and counted in `summary.ignoredByComment`, both additions to the schema; the action sets the `ignored-by-comment` output. - **Two new warnings:** [FP904](https://ciatlas.github.io/flowpact/docs/rules/fp904) reports a `# flowpact:` comment that names an unknown rule or is not `ignore[]`, and [FP905](https://ciatlas.github.io/flowpact/docs/rules/fp905) one whose rule reports nothing on its line. A repository that has no `# flowpact:` comments gets neither. ## 0.21 → 0.24 [#021--024] Nothing to change. What is new: - **Editor:** [quick fixes](https://ciatlas.github.io/flowpact/docs/editors#quick-fixes), **Accept this finding with an override**, [rename](https://ciatlas.github.io/flowpact/docs/editors#rename), [completion](https://ciatlas.github.io/flowpact/docs/editors#completion) of the inputs and secrets a call does not pass yet, and hover and go to definition in contract files, for a step's own `env`, and from `steps..outcome` to the step. A repository with no `.github` folder, such as an action's, is now analyzed, so its findings appear. - **Reports:** a finding flowpact can fix with certainty carries `suggestions` in the [JSON report](https://ciatlas.github.io/flowpact/docs/cli#json-report) and `fixes` in SARIF. Both are additions to the existing schemas. ## 0.20 → 0.21 [#020--021] ### Remote interfaces lockfile [#remote-interfaces-lockfile] `flowpact remotes update` now records, for a remote reusable workflow, the secrets it reads without declaring them (`undeclaredSecrets`), and [FP205](https://ciatlas.github.io/flowpact/docs/rules/fp205) reports a call of it without `secrets: inherit`. The first `remotes update` lists those entries as `changed`, though their commits are the same. flowpact 0.20 and earlier refuse a lockfile with this key (FP611) and then check no remote call. **Update every flowpact that reads the lockfile (the action's pin, the CLI, the editor extension) before running `remotes update` with 0.21.** From 0.21, a key a later version adds is ignored instead. ### New findings [#new-findings] FP205 reports calls of remote reusable workflows without `secrets: inherit` whose secrets the lockfile records, and, with `--fetch-remotes` or the action's `remotes: fetch`, those it fetches for the run. Use `secrets: inherit`, or add an override on the symbol (`octo/ship/.github/workflows/ship.yml@v1#secrets.NPM_TOKEN`). FP205 no longer reports a read where GitHub allows no `secrets` (an input default, a `workflow_call` output, `jobs..with`, `if` or `name`). [FP612](https://ciatlas.github.io/flowpact/docs/rules/fp612) also reports a lockfile entry that records another commit than the full commit SHA its reference pins (`octo/setup@`). `remotes update` never writes one, so only an edited lockfile has it; flowpact no longer checks calls against such an entry. Run `flowpact remotes update` to correct it. ### Sources cache [#sources-cache] `flowpact remotes update` now keeps the workflow files and `action.yml`s it reads in a per-user [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor), for go to definition in the editor, and prunes it to the 3 most recently used commits of each repository. Nothing to do: it keeps nothing in CI unless you ask (`--cache-dir`), and `--no-cache` turns it off. `remotes update` also no longer loads the plugins your config lists: it runs no rule. ## Older releases [#older-releases] **Remote interfaces lockfile** 0.20 writes a leaner lockfile: an input or secret is marked `required: true` only when it is, and `required: false` is left out. An entry read on github.com through the new opt-in fallback records `host: github.com`. flowpact 0.19 refuses such a lockfile ([FP611](https://ciatlas.github.io/flowpact/docs/rules/fp611)) and then checks no remote call, so **update every flowpact that reads the lockfile (the action's pin, the CLI, the editor extension) before running `remotes update` with 0.20**. `flowpact remotes update` takes paths, like the other commands, to fetch only what given workflows and actions use; a path that names nothing is an error (exit 2). It shows its progress and the source of its token, and says why a reference could not be fetched. **GitHub Enterprise Server and GHE.com** `--github-com` (the action's `remotes-github-com` and `github-com-token` inputs) also looks on github.com for the references the enterprise server lacks, as the runner does through GitHub Connect. It is opt-in, because it sends those references' names to github.com; see [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces#github-enterprise-server-and-ghecom). 0.19 checks calls into other repositories, once you record their interfaces, and grades more kinds of change in impact mode. **Remote interfaces** `flowpact remotes update` writes `.github/flowpact/remotes.lock.yaml`, the interfaces of the reusable workflows and actions you call from other repositories. With it committed, those calls are checked like local ones (FP101–FP103, FP201, FP202, FP301), and [FP603](https://ciatlas.github.io/flowpact/docs/rules/fp603) no longer reports a remote workflow the lockfile has. Without a lockfile nothing changes. Two new rules apply only when there is one: [FP611](https://ciatlas.github.io/flowpact/docs/rules/fp611) (error) for a lockfile that cannot be used, and [FP612](https://ciatlas.github.io/flowpact/docs/rules/fp612) (warning) for one that lacks a reference the repository uses or has one it no longer uses, as after a Renovate or Dependabot update. The action reads the lockfile as committed; `remotes: fetch` fetches what it lacks for the run. See [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces). 0.19.1 records references it cannot read under the lockfile's `unreadable:`, which 0.19.0 refuses (FP611). Use 0.19.1 or later wherever the lockfile is read. **Impact mode grades more** Impact mode now also grades what a published reusable workflow or action does in its callers' runs, so a pull request can require more than before: | Change | Required | | --- | --- | | An output is now set only when an `if:` holds | major, uncertain ([FP814](https://ciatlas.github.io/flowpact/docs/rules/fp814)) | | A job needs a runner label or group callers may not have | major (uncertain when chosen at run time) | | A job gains, changes or loses its `environment:` | minor | | An artifact callers download is no longer uploaded, or renamed | major | | Jobs or steps changed, and nothing else is graded | patch | A patch never fails a pull request, so most repositories see the change only in the verdict: a `chore:` pull request that changes steps now reports "requires patch" ([FP813](https://ciatlas.github.io/flowpact/docs/rules/fp813)) instead of "none". A pull request whose title declares less than a minor or major it now requires fails with [FP810](https://ciatlas.github.io/flowpact/docs/rules/fp810); declare the release it needs, or accept the finding with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides). See [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode). 0.18 writes new contracts as `.contract.yaml` and reads `.contract.yaml` and `.contract.yml` alike. Existing contracts keep their names, so a repository that locks contracts sees no change. **Contract file names** `flowpact generate` names a new contract `.contract.yaml`, except in a repository whose contracts are all `.contract.yml`, where it keeps to `.contract.yml` so the directory has one extension. A contract named either way is read, compared and updated under its own name. To move a repository to `.contract.yaml`, rename its contract files (`git mv`): each contract names its unit, so a renamed file is still that unit's contract, and `flowpact check` stays clean. Where tooling or `CODEOWNERS` matches `*.contract.yml`, match `*.contract.yaml` too. 0.17 follows secrets as GitHub holds them, and places some findings more exactly. No finding is added or removed: what changes is where a few findings are, and what `flowpact trace`, the editor, the JSON report's graph and custom rules see of secrets. **Finding locations** A finding on an expression that spans lines in a block scalar, or on a double-quoted scalar with escapes, now ends where the expression ends in the file: [FP502](https://ciatlas.github.io/flowpact/docs/rules/fp502)'s range, for example, ended early. A reference written after a property that follows a dot and spaces or a line break (`fromJSON(x). inputs.a`) is now located at the reference, not at the property, and so is an expression whose `${{` or `}}` is written with an escape (`\x7d`). A finding's fingerprint does not include its location, so code scanning keeps these alerts. **`flowpact trace`, the editor and custom rules** `flowpact trace` now names the workflow of a secret or input that no file declares, such as a secret a called workflow reads through `secrets: inherit` without declaring it: `#secrets. (unresolved)`, where 0.16 showed `secrets. (unresolved)` alone. In `--format json`, such a node has the workflow as its `unit` and `secrets.` as its `label`. A whole or computed `secrets` (`toJSON(secrets)`, `secrets[inputs.name]`) now also reads each secret the workflow reads by name or is passed by name, and its `GITHUB_TOKEN`; in a workflow that callers hand every secret to through `secrets: inherit`, also each secret those callers declare, read by name or are passed by name. `flowpact trace` and the editor's hover list them, and the editor's references of such a secret include the whole read. `secrets: inherit` follows a secret to the other workflow's own spelling of it, in any letter case, both ways, and no longer to a caller's `GITHUB_TOKEN`, which GitHub gives every workflow itself. The JSON report's graph, and the symbol and edge counts in the summary, gain these secrets. **Custom rules:** `usagesOf` lists a whole or computed `secrets` read as a usage, marked `whole`, of each of the secrets above. A secret read by name, and `GITHUB_TOKEN`, now have these usages next to their reads by name, and an inherited secret that the workflow does not name, which had no usage, now has them. 0.16 follows inputs that a workflow reads through `github` as GitHub does. A workflow's own inputs are in `github.event.inputs` only when the workflow is dispatched. When it is called, GitHub gives it the caller's `github` context, so there `github` never holds what the caller passes in `with:`. Some findings change, and each change below says what to do about it. **New and changed findings** - [FP104](https://ciatlas.github.io/flowpact/docs/rules/fp104) reports more inputs that nothing reads: - in a workflow that can be both dispatched and called, an input that only `workflow_call` declares and that is read only as `github.event.inputs.`; - in a workflow or composite action that reads `toJSON(github.event)`, `toJSON(github.event.inputs)` or `github.event.inputs[]`, any input other than a `workflow_dispatch` input that nothing else reads (0.15 skipped every input of such a workflow or action); - a dispatch input read only through `github` in the workflow's own input defaults or `workflow_call` outputs, which GitHub evaluates only when the workflow is called. Remove the input, or read it as `inputs.`, which holds a workflow's `workflow_dispatch` inputs when it is dispatched and its `workflow_call` inputs when it is called (and an action's own inputs). An input default or `workflow_call` output is evaluated only when the workflow is called, so to read a dispatch input there, also declare it under `workflow_call`. - [FP105](https://ciatlas.github.io/flowpact/docs/rules/fp105) now reports a condition that reads an optional dispatch input without a default as `github.Event.Inputs.`, in any letter case, as it did for `github.event.inputs.`: give the input a default, or compare it explicitly, as for `inputs.`. It no longer reports a condition that reads, as `github.event.inputs.`, an input that only `workflow_call` declares, since the condition never reads that input: FP104 reports the input if nothing else reads it. - [FP106](https://ciatlas.github.io/flowpact/docs/rules/fp106) now also reports a passed input that the called workflow reads only through a step's own `env:` value that reads `github`, where the step reads that value as `env.`, or only through `toJSON(github.event)`, `toJSON(github.event.inputs)` or `github.event.inputs[x]`, and a passed input that such a workflow never reads (0.15 skipped those workflows). For an input read only through `github`, the message now says it is read "only through the github context, the caller's when it is called". 0.15 said "only through github.event.inputs, the caller's event when it is called" for `github.event.inputs.`, and "never reads it" for `toJSON(github)`, `github.event[x]` and `github.Event.Inputs.` in another letter case. In a called workflow that can also be dispatched, an input that only `workflow_call` declares and that is read as `github.event.inputs.`, or one read through `github` only in the workflow's own input defaults or `workflow_call` outputs, is now reported as never read. Read the input as `inputs.` in the called workflow, or stop passing it. - [FP401](https://ciatlas.github.io/flowpact/docs/rules/fp401) no longer reports an optional input with an empty default (none, or `default: ''`) passed to a workflow that can be called when the conditions that read it read it only through `github`, which never holds what the caller passes. A required input, or one whose non-empty default the empty value replaces, is still reported. Delete the overrides that [FP902](https://ciatlas.github.io/flowpact/docs/rules/fp902) now reports: FP105 and FP401 findings that are gone leave their overrides matching nothing. The reworded FP106 findings keep their overrides, which match the rule, target and file, not the message. Code scanning closes the alerts of reworded findings and opens new ones once, because an alert's fingerprint includes its message. **`flowpact trace`, the editor and custom rules** `flowpact trace` and the editor follow reads of `github` the way the findings do. `flowpact trace` now follows `toJSON(github)` and `github.event[x]`, and the editor lists them among a dispatch input's references. Trace, hover, go-to-definition and references now follow `github` reads and step outputs written in another letter case (`github.Event.Inputs.`, `steps..Outputs.`), and the editor resolves `needs..Outputs.` to the output rather than the job. They no longer follow `github` in a workflow's own input defaults and `workflow_call` outputs, nor `github.event.inputs.` for an input that no `workflow_dispatch` declares. The JSON report's graph, and the symbol and edge counts in the summary, change with them. **Custom rules:** in a workflow that can be dispatched, `usagesOf` for a `workflow_dispatch` input now also lists: - whole or computed `github` reads (`toJSON(github)`, `github.event[x]`), marked `whole`, also through a step's own `env:` value; - `github.Event.Inputs.`, in any letter case. `usagesOf` no longer lists: - `github.event.inputs.` as a usage of an input that only `workflow_call` declares, or of a name that no trigger declares; - for a `workflow_dispatch` input, reads of `github` in the workflow's own input defaults and `workflow_call` outputs. A read of one output written in another letter case (`needs..Outputs.`, `steps..Outputs.`) is no longer marked `whole`, and a `run:` step's output read that way is now a usage. A rule about the value a caller passes should skip usages through `github` (see `Usage.whole` in the API types). 0.15 changes what some runs report. Each change below says what to do about it. **Impact mode honours paths** [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode#only-some-units) with paths (`lint --impact `, `check --impact `, the action's `paths` input with `impact`, the API's `paths`) now grades only the published workflows and actions within them. Before, it graded every published unit but reported only the findings about files within the paths, so a breaking change elsewhere could pass silently: the verdict said `required major` and the run passed. Now the verdict and the findings agree. If your impact check passes paths, it now guards only the units within them: drop the paths to gate every published unit. `flowpact impact` takes paths too, where 0.14 refused them. A removed or renamed unit is graded only when its old path, or a directory holding it, is among the paths, so prefer directory paths (`actions/`) in the action's `paths` input; a path that names only the removed unit fails later pull requests once the removal is merged. A path the change removed is no longer refused as missing in impact mode. Where impact mode is skipped on `merge_group` or `push`, such a path is only warned about, as is a removed action's directory that keeps other files, and so is a mistyped path: without a baseline the two cannot be told apart. These events usually follow a pull request's run, which has the baseline and refuses a mistyped path, but not always: the first push of a new branch comes before any pull request, and a workflow that runs only on `push` with `impact: auto` never refuses one, where 0.14 failed. To have such a workflow refuse it, use `impact: on`, which compares each push with the commit before it (a new branch's first push, which has none, still only warns). On other events, a skipped impact mode still refuses these paths. `flowpact graph` takes paths as well, and then draws only those workflows and actions and what they call. **Orphaned contracts within the paths** `flowpact check ` reports the orphaned contract (`FP804`) of a workflow or action that no longer exists when its path lies within the paths, and `flowpact generate ` deletes it; 0.14 left it to runs without paths. A `check` job with paths may now fail on such a contract: run `flowpact generate` to delete it. **Impact mode leaves ignored units out** A published workflow or action whose file both the baseline's `ignore` and the pull request's match is no longer graded. 0.14 graded it but dropped its findings, so the verdict could say `required major` while the run passed. Now the verdict and the findings agree, and impact mode's findings are never dropped by `ignore`. If an ignored unit is one you publish, remove it from `ignore` to gate its changes: the pull request that removes it is already graded for it. When `ignore` leaves out every published unit, `impact: auto` skips the run as in a repository that publishes nothing, and `impact: on` reports the verdict on the first workflow or action file (within the paths) that is not ignored, or is skipped, saying so, when every one is. The reports name the published units `ignore` left out (`left out by ignore: …`, and `impact.ignored` in the JSON report). Because a unit is left out only when the baseline's `ignore` matches it too, a pull request's own `ignore` edit cannot take a published unit out of its check: a pull request that adds one to `ignore` is still graded for it. Where it under-declares, it now fails with `FP810`, where 0.14 dropped the finding and passed with `impact-ok: false`. Every other finding follows the pull request's own `ignore`, as before. A [base config](https://ciatlas.github.io/flowpact/docs/impact-mode#configuration) that the checked-out commit does not track, such as the organization's config checked out into an ignored directory of the workspace, now counts on both sides, as one outside the repository does: the published units its `ignore` matches are left out, and its impact settings apply to the baseline too, where 0.14 left them out as those of a file of the repository. A base config within a submodule is the pull request's own, as a file of the repository is, and its `ignore` counts on the baseline's side as the baseline's commit of the submodule has it. 0.14 reads more of what workflows write: a read of a whole object or through a computed key (`toJSON(inputs)`, `matrix[inputs.key]`, `secrets.*`), an input's `default:` where a caller omits the input, and `github.event.inputs` in a workflow that can be called, which holds the caller's event there. A few findings change with it. **Regenerate your contracts** A call to a reusable workflow whose matrix has an `include` or `exclude` item that is an expression (`- ${{ fromJSON(inputs.extra) }}`) now records its matrix as `exact: false`, since that item is only known at runtime; with such an `exclude` item it also records the combinations it knows, where 0.13 recorded none. If you lock contracts, `flowpact check` reports [FP802](https://ciatlas.github.io/flowpact/docs/rules/fp802) for such a call until you run `flowpact generate` and commit the result. **New and changed findings** - **[FP404](https://ciatlas.github.io/flowpact/docs/rules/fp404)** no longer reports a matrix key as missing from every combination when an `exclude` item is an expression: such an item removed every combination before. - **[FP403](https://ciatlas.github.io/flowpact/docs/rules/fp403)** (info) now notes a matrix whose `include` has an item that is an expression: the keys it adds are only known at runtime. - **[FP104](https://ciatlas.github.io/flowpact/docs/rules/fp104) and [FP203](https://ciatlas.github.io/flowpact/docs/rules/fp203)** no longer report an input or a secret that is read through a `*` filter (`inputs.*`, `github.event.inputs.*`, `secrets.*`), nor [FP106](https://ciatlas.github.io/flowpact/docs/rules/fp106) a value passed to an input that the callee reads through `inputs.*`. - **[FP106](https://ciatlas.github.io/flowpact/docs/rules/fp106)** now reports a value that a caller passes to a workflow which reads the input only through `github.event.inputs`: when the workflow is called, that is the caller's event, not the value passed. - **Locations:** a finding placed at the start of a bare `if:` written as a block scalar (`if: |`) or a quoted scalar, such as [FP505](https://ciatlas.github.io/flowpact/docs/rules/fp505) for `hashFiles()` in a job's `if:`, now points at the expression rather than at the `|` or the quote, and a reference whose text also appears earlier inside a string literal is located at the reference. Code scanning may close and reopen those alerts once. **`flowpact trace` and custom rules** - `flowpact trace --up` also ends at an omitted input's `default:`, follows a whole read to each member, and shows a `github.event.inputs` read in a workflow that can be called as the dispatch input `(when dispatched)` next to the caller's event. The tree now prints each branch's note, such as `(exposed to the caller)`. See [`flowpact trace`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-trace). - In [custom rules](https://ciatlas.github.io/flowpact/docs/custom-rules), `usagesOf` now includes whole and computed reads of `inputs`, `matrix`, `secrets` and `env`, marked `whole`. A rule about how one specific input or key is read should skip them. The action moved to `ciatlas/flowpact`. GitHub redirects the old name, so `rumankazi/flowpact@v0.11` and older references keep working, but use the new one from now on. flowpact moved to the [ciatlas](https://github.com/ciatlas) organization: the repository is now `ciatlas/flowpact` and the docs are at [ciatlas.github.io/flowpact](https://ciatlas.github.io/flowpact). The npm package, the VS Code extension and the GitHub Marketplace listing keep their names, and nothing changes in what flowpact reports. **Regenerate your contracts** Contracts name their schema and docs by URL, and both moved. Until you run `flowpact generate` once and commit the result, `flowpact check` reports [FP802](https://ciatlas.github.io/flowpact/docs/rules/fp802) for every contract written by 0.11 or earlier. If your `.github/flowpact/flowpact.config.yml` starts with a `# yaml-language-server: $schema=` line (for editor completion), point it at `https://ciatlas.github.io/flowpact/schemas/config/v1.json`: the old docs and schema URLs under `rumankazi.github.io/flowpact` no longer resolve. **Verifying older releases** Releases up to 0.11.1 were built before the move, and GitHub keeps their attestations under the old owner: verify them online with `--owner rumankazi`, or offline against the bundle attached to the release with `gh attestation verify --bundle .sigstore.json --repo rumankazi/flowpact`. `gh release verify` no longer finds their release attestations. See [verify a release](https://ciatlas.github.io/flowpact/docs/security#verify-a-release). 0.10 is for organizations that build on flowpact: a [programmatic API](https://ciatlas.github.io/flowpact/docs/api) with a function per command, the action's `base-config` and `plugin` inputs for a [copy of the action](https://ciatlas.github.io/flowpact/docs/integrating#copy-the-action), and an action about a third of its old size. Nothing changes for workflows that use the action or the CLI as before, except a copy of the CLI's `dist/index.js` on its own (see below). **A vendored CLI is its whole package folder** The npm package's `dist/index.js` now loads a second file next to it (code it shares with the API), so a copy of `dist/index.js` alone no longer runs. It fails with exit code `1`, the code for findings: ```text Error [ERR_MODULE_NOT_FOUND]: Cannot find module '…/dist/chunk-.js' imported from …/dist/index.js ``` Keep the package's whole `package/` folder, as [Run the CLI in a step](https://ciatlas.github.io/flowpact/docs/integrating#run-the-cli-in-a-step) shows: `node tools/flowpact/dist/index.js lint …`. The second file's name changes with each release, so to update, replace the folder rather than copy the new files into it. 0.9 is for organizations that run flowpact in their own action or CI template ([Roll it out across an organization](https://ciatlas.github.io/flowpact/docs/integrating)): GitHub annotations from the CLI, several reports from one run, `--plugin` and `--no-plugins`, and a [base config](https://ciatlas.github.io/flowpact/docs/configuration#base-config). One change can fail a CI run: options must come after the command. **Put options after the command** Before 0.9, an option written before the command was dropped without a word: `flowpact --no-plugins lint` ran with the repository's plugins, and `flowpact -q lint` was not quiet. 0.9 stops with a usage error (exit `2`) instead. Write `flowpact lint --no-plugins`. `flowpact --help` and `flowpact --version` work as before. **Config entries for rules that are not loaded** A `rules:` or `overrides:` entry for a rule that no loaded plugin defines used to stop the run with a config error. 0.9 ignores it with a warning, so a repository can configure organization rules that only its organization's wrapper loads. An unknown code with the built-in prefix (`FP999`), or a typo of a loaded rule (`unused-inptu`), is still an error; see [Rules that are not loaded](https://ciatlas.github.io/flowpact/docs/configuration#rules-that-are-not-loaded). 0.8 removes most false positives found on 28 large public repositories, so most repositories see fewer findings. Two things can still fail a CI run right after the upgrade: contracts written by 0.7, and overrides for findings 0.8 no longer reports. **Regenerate your contracts** If the repository locks its contracts (`.github/flowpact/contracts/`), run `flowpact generate` and commit the result. 0.8 records more of each interface: - A read of a whole outputs object, such as `toJSON(needs.build.outputs)` or `needs.build.outputs[matrix.key]`, now counts as reading every output in it, and the callee's contract lists them. - Actions used through a checkout `path:` or the new `$/` syntax now resolve, so their callers appear under `uses`. Until then, `flowpact check` reports those contracts as [FP802](https://ciatlas.github.io/flowpact/docs/rules/fp802) (contract-outdated, an error). In `mode: check` the action attaches the regenerated contracts as an artifact and a patch. **Remove overrides that no longer match** Overrides written for findings that 0.8 no longer reports match nothing. [FP902](https://ciatlas.github.io/flowpact/docs/rules/fp902) (override-unused, a warning) names each one so you can delete it: - **FP606** for actions used through a checkout `path:`: a step's `uses: ./path` now resolves against the runner's workspace, as GitHub does. - **FP303** for outputs of published units: reusable workflows whose file name does not start with `_`, and the root `action.yml`, or exactly the units in [`impact.publish`](https://ciatlas.github.io/flowpact/docs/impact-mode#configuration) when it is set. - **Findings inside [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files)** (`*.lock.yml`, or a header such as `DO NOT EDIT`), for the rules about a file's own internals: FP104, FP105, FP203, FP204, FP303, FP304, FP604, FP605 and FP607. - **FP105, FP205, FP401, FP402 and FP404** where the workflow already handles the empty value: a fallback (`matrix.k || 'x'`), a comparison, a quoted shell test, or a caller whose inputs skip the step. - **FP302** for a job's own `if:` that reads a job it depends on indirectly: GitHub makes those visible there. - **FP503** for background steps and `cache-mode`, which GitHub runs. **New and changed findings** - **[FP610](https://ciatlas.github.io/flowpact/docs/rules/fp610) (workspace-unverified, info)** marks a step's `uses: ./…` that flowpact cannot read, such as a path inside another repository's checkout. Write `owner/repo/path@ref` to have those actions checked, or set `FP610: off`. - **[FP606](https://ciatlas.github.io/flowpact/docs/rules/fp606)** can fire where it was silent: an action of this repository used as `./…` in a job that checks the repository out only in a subdirectory, or a composite action's `./path` that works for one caller and not for another. - **[FP105](https://ciatlas.github.io/flowpact/docs/rules/fp105)** now also reports published units when every local caller passes the input, because callers in other repositories can still omit it. - **[FP401](https://ciatlas.github.io/flowpact/docs/rules/fp401)** is a warning when the empty value replaces a non-empty `default`, and is not reported when the input is optional with an empty default that no condition reads (or reads only through a fallback). **[FP404](https://ciatlas.github.io/flowpact/docs/rules/fp404)** reports a fallback that always applies as info. - **[FP503](https://ciatlas.github.io/flowpact/docs/rules/fp503)** reports keys GitHub accepts and ignores, such as a top-level `env:` in `action.yml`, as warnings. - If a hand-written file is treated as generated, list it under `generated.exclude`. If other repositories use an action in a subdirectory, list it under `impact.publish`; that setting replaces the default list, so include your other published units too. **Code scanning alerts** A finding's fingerprint includes its message. Messages changed for some FP105, FP205, FP302, FP401, FP404 and FP503 findings, so those alerts close and reopen once. If you had dismissed one, dismiss the new alert again. **`flowpact generate` with paths** `flowpact generate ` now writes only the contracts of those workflows and actions, and leaves the others (including orphaned ones) alone. A path that names no workflow or action exits with code 2. # GitHub Action (https://ciatlas.github.io/flowpact/docs/action) The flowpact action ([GitHub Marketplace](https://github.com/marketplace/actions/flowpact)) runs the same engine as the [CLI](https://ciatlas.github.io/flowpact/docs/cli), bundled into the action itself, so the job does not need Node.js or a package install. On top of the CLI's checks it: - **annotates** every finding on the file and line it is about, in the run and in the pull request diff; - writes a **job summary** with the findings, their fixes and links to the rule docs; - writes **JSON, SARIF or Markdown reports** for other steps (for example code scanning); - in `check` mode, when [contracts](https://ciatlas.github.io/flowpact/docs/contracts) drifted, **uploads the regenerated contracts and a patch** as an artifact, so anyone can update them without running flowpact. `ciatlas/flowpact@v0.29` follows the patch releases of its minor line. Before 1.0 each minor line has its own tag (`v0.`), because a minor release can change what is reported, so moving to the next one is your choice; a breaking change is a major release (1.0.0 and `v1` next). Pin an exact release (`ciatlas/flowpact@v0.29.2`) or a commit SHA to control every update. ## Usage [#usage] ### Lint workflows on pull requests [#lint-workflows-on-pull-requests] ```yaml title=".github/workflows/flowpact.yml" name: Workflow contracts on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: ciatlas/flowpact@v0.29 ``` The workflow runs on every pull request. If you make the flowpact job a required status check, do not add a `paths:` filter: a pull request that touches none of the paths skips the workflow, and GitHub then leaves the required check pending, so the pull request cannot merge ([GitHub docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks)). To filter a check that is not required, list everything flowpact reads: `'.github/workflows/**'`, `'.github/flowpact/**'`, `'**/action.yml'` and `'**/action.yaml'` (a local action can live anywhere, including the repository root). The step fails when there are errors. Use `fail-on: warning` to be stricter or `fail-on: never` to report without failing. ### Check contracts and hand out the fix [#check-contracts-and-hand-out-the-fix] Once you commit contracts (`flowpact generate`, see [Contracts](https://ciatlas.github.io/flowpact/docs/contracts)), use `mode: check`. It runs every lint rule and also fails when the contracts no longer match the workflows: ```yaml steps: - uses: actions/checkout@v7 - uses: ciatlas/flowpact@v0.29 with: mode: check ``` When contracts drifted, the action uploads a `flowpact-contracts` artifact with a patch, and the job summary says how to apply it (see [Contract drift without the CLI](#contract-drift-without-the-cli)). ### Upload findings to code scanning (SARIF) [#upload-findings-to-code-scanning-sarif] ```yaml jobs: flowpact: runs-on: ubuntu-latest permissions: contents: read security-events: write steps: - uses: actions/checkout@v7 - uses: ciatlas/flowpact@v0.29 with: report-sarif: flowpact.sarif - if: always() uses: github/codeql-action/upload-sarif@v4 with: sarif_file: flowpact.sarif category: flowpact ``` `if: always()` uploads the report even when the flowpact step failed because of findings. Findings then appear under **Security → Code scanning**. Findings accepted by an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides) or an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) are left out: code scanning has no way to mark them as accepted and would open an alert for each. The JSON report lists them under `suppressed` and `ignoredByComment`. ### Use the outputs [#use-the-outputs] ```yaml - id: flowpact uses: ciatlas/flowpact@v0.29 with: mode: check fail-on: never - if: steps.flowpact.outputs.breaking != '0' run: echo "::warning::${{ steps.flowpact.outputs.breaking }} breaking contract change(s)" ``` ## Inputs [#inputs] All inputs are optional. | Input | Default | Description | | --- | --- | --- | | `mode` | `lint` | `lint` analyzes workflows and local actions. `check` also compares them with the locked contracts in `.github/flowpact/`. | | `paths` | `''` | Workflow or action files or directories to report on, separated by spaces or newlines, relative to working-directory. Empty reports on everything. With `impact`, only the published workflows and actions within them are graded, so the impact verdict is about those alone; prefer directories, so a removed or renamed one stays within them ([Only some units](https://ciatlas.github.io/flowpact/docs/impact-mode#only-some-units)). | | `working-directory` | `.` | Directory holding the `.github` folder to analyze, relative to the workspace. | | `config` | `''` | Path to the flowpact config file, relative to working-directory. Empty uses `.github/flowpact/flowpact.config.yml` when it exists. | | `fail-on` | `error` | Fail the step when findings at this level exist: `error`, `warning` or `never`. | | `annotations` | `true` | Annotate findings on the files in the run and pull request. | | `summary` | `true` | Write a Markdown report to the job summary. | | `summary-graph` | `false` | Add the workflow call graph (Mermaid) to the job summary. | | `max-findings` | `50` | Findings listed in full in the job summary; the rest are counted. | | `report-json` | `''` | Write the JSON report to this path (relative to the workspace). | | `report-sarif` | `''` | Write a SARIF 2.1.0 report to this path (relative to the workspace), for github/codeql-action/upload-sarif. | | `report-markdown` | `''` | Write the Markdown report to this path (relative to the workspace), e.g. for a pull request comment. | | `upload-contracts` | `true` | In check mode, when contracts drifted, upload the regenerated contracts and a patch as an artifact. | | `artifact-name` | `flowpact-contracts` | Name of the contract drift artifact. Defaults to `flowpact-contracts-` when `working-directory` is set. Must be unique per run — set it in matrix jobs. | | `retention-days` | `7` | Days to keep the contract drift artifact (0 uses the repository default). | | `plugins` | `auto` | Load the plugins listed in the config: `auto`, `true` or `false`. Plugins run JavaScript from the checkout; `auto` disables them on `pull_request_target` and `workflow_run` events. | | `base-config` | `''` | 0.10.0 and later. A [base config](https://ciatlas.github.io/flowpact/docs/configuration#base-config) under the repository's config, such as an organization's defaults. A relative path is read from the action's own directory, so an organization's [copy of the action](https://ciatlas.github.io/flowpact/docs/integrating#copy-the-action) can ship it. | | `plugin` | `''` | 0.10.0 and later. Plugins to load in addition to those the config lists, one path per line, such as an organization's rules; relative paths are read from the action's own directory. They load whatever `plugins` says, except files in the checkout when plugins from the checkout may not run. | | `impact` | `off` | [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode): `off`, `auto` (on pull requests, or on any event when `base-ref` is set, in repositories that publish workflows or actions that `ignore` does not leave out, and with `paths` when one is within them; never on `pull_request_target`) or `on`. | | `expected-impact` | `''` | The declared impact (`none`, `patch`, `minor`, `major`); overrides the pull request title and labels. | | `base-ref` | `''` | Baseline for impact mode: a commit, tag or branch (read from `origin/`, fetched when missing). Empty uses the pull request base, the commit before a push, or the last release tag for a release pull request. | | `remotes` | `lockfile` | Remote workflows and actions: `lockfile` checks them against the committed [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) only; `fetch` also fetches, with `token`, the interfaces of the references it lacks, for this run, and on a pull request (or with `base-ref`) grades the references it moves to another version ([version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#on-a-pull-request)). Never on `pull_request_target` or `workflow_run`. | | `remotes-github-com` | `false` | With `remotes: fetch` on GitHub Enterprise Server or GHE.com: also look on github.com for the references the enterprise server lacks, as GitHub Connect does. It sends their names to github.com. | | `github-com-token` | `''` | The token for github.com with `remotes-github-com`; `token` is never sent there. Empty reads public repositories without one. | | `token` | `${{ github.token }}` | Used to fetch the baseline commit or release tags when the checkout is shallow, and with `remotes: fetch` to read the remote repositories (private and internal ones need a token that can read them). | | `debug` | `false` | Print flowpact debug logs (also enabled by re-running the job with debug logging). | Even when `paths` limits the report to some files, flowpact reads every workflow and local action, because findings depend on the callers and callees. With `impact`, `paths` narrows the impact gate too: a change to a published workflow or action outside them is not graded. ## Outputs [#outputs] | Output | Description | | --- | --- | | `errors` | Number of error findings. | | `warnings` | Number of warning findings. | | `infos` | Number of info findings. | | `suppressed` | Number of findings accepted by overrides. | | `ignored-by-comment` | Number of findings accepted by `# flowpact: ignore[…]` comments. | | `findings` | Total number of findings (errors, warnings and info). | | `drift` | `true` when check mode found that the contracts drifted, otherwise `false`. | | `breaking` | Number of breaking contract changes (check mode). | | `exit-code` | The exit code the CLI would return: 0, 1 when findings reach fail-on, or 2 when the action stopped before reporting (invalid input or config, no workflows found, unexpected error). | | `report-json` | Absolute path of the JSON report, when report-json was set. | | `report-sarif` | Absolute path of the SARIF report, when report-sarif was set. | | `patch` | Absolute path of the contract patch on the runner, when contracts drifted. | | `artifact-id` | ID of the uploaded contract drift artifact, when one was uploaded. | | `required-impact` | Impact mode: the impact the changes require (`none`, `patch`, `minor`, `major`). | | `declared-impact` | Impact mode: the impact the pull request declares; empty when nothing is declared. | | `impact-ok` | Impact mode: `true` when the declaration covers the changes (or nothing is declared), `false` otherwise; empty when impact mode did not run. | | `version-changes` | With `remotes: fetch` on a pull request: how many remote references it moves to another version were graded; empty when none were looked for. | | `version-verdict` | The worst verdict of those [version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#on-a-pull-request): `breaks`, `unchecked` or `fits`; empty when none were graded. | ## Annotations [#annotations] Each finding becomes an error, warning or notice annotation (matching its severity) on the file and line it is about. The title is the rule code and name, and the message ends with the suggested fix and a link to the rule's docs page. With `working-directory`, file paths are adjusted so annotations land on the right files in the repository. GitHub limits how many annotations a single step can show. The job summary lists the first `max-findings` findings (raise it if needed); the SARIF and JSON reports list every finding, so use those when a run has many. ## Job summary [#job-summary] The summary has: - the tool and schema versions and how long the analysis took; - a status line and a table of counts (errors, warnings, info, suppressed by overrides and ignore comments, workflows, actions, jobs, matrix combinations); - the findings, errors first, each with its rule docs link, its location (linked to the file at the commit being checked), the affected matrix combinations, and a collapsed **Why / fix** section with the related locations; - in `check` mode, a **Contracts** section: which contract files are new, changed or removed, every change (breaking ones in bold) and how to apply the regenerated contracts; - when [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) ran, an **Impact** section: the impact the changes require, the declared impact and whether it covers them, with every graded change; - with `remotes: fetch` on a pull request that moves a remote reference to another version, a **Version changes** section: each one's verdict, its interface changes, and the calls it breaks or leaves partly unchecked; - the findings accepted by overrides, in a collapsed table with each override's reason, expiry and owner; - with `summary-graph: true`, the call graph between workflows and local actions as a Mermaid diagram. After `max-findings` findings, the rest are only counted. This is the summary for a repository where one matrix leg passes an empty input to a reusable workflow (the `incident-matrix` fixture in the flowpact repository), regenerated each time these docs are published. In a run, the locations are links to the files at the commit: ```markdown ## flowpact lint flowpact v0.29.2 · config schema v1 · contract schema v1 · report schema v1 · 12 ms ❌ **1 error** | Errors | Warnings | Info | Suppressed | Workflows | Actions | Jobs | Matrix combinations | | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | | 1 | 0 | 0 | 0 | 3 | 0 | 3 | 3 | ### ❌ Errors (1) **[`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401) empty-binding-for-matrix-combo** · `.github/workflows/tests.yml:23:19` Input "config" for .github/workflows/run-suite.yml is empty in 1 of 3 matrix combinations — matrix.config is not defined there Matrix: `{ name: windows }`
Why / fix **Why:** GitHub evaluates a missing matrix key to an empty string — no error, no warning. The affected matrix leg runs with an empty input, so the callee may skip its real work (e.g. a test configuration) while the run stays green. **Fix:** Set `config` in every combination, or use a fallback: `${{ matrix.config || '' }}`. **Related locations:** - `.github/workflows/pipeline.yml:9:11` — jobs.tests calls .github/workflows/tests.yml - `.github/workflows/tests.yml:18:13` — this include entry has no `config` - `.github/workflows/run-suite.yml:11:7` — receives the empty value: input "config" - `.github/workflows/run-suite.yml:17:9` — this condition reads "config", so the legs with an empty value take the other branch
```
`report-markdown` writes the same Markdown to a file, for example to post it as a pull request comment with another action. ## Contract drift without the CLI [#contract-drift-without-the-cli] In `check` mode, when the contracts drifted, the action writes: - `flowpact-contracts.patch`: a patch, relative to the repository root, that creates, updates and deletes the contract files; - `flowpact-contracts/README.md`: how to apply it; - `flowpact-contracts/`: the regenerated contracts, for reference (removed contracts are only in the patch). With `upload-contracts: true` (the default) these are uploaded as the `flowpact-contracts` artifact (`artifact-name`), kept for `retention-days` days. The artifact holds only the patch and the `flowpact-contracts/` folder, so downloading it into the repository does not overwrite any file. To update the contracts without Node.js or flowpact: ### Download the artifact [#download-the-artifact] From the repository root, with the [GitHub CLI](https://cli.github.com) (the job summary shows this command with the run ID filled in): ```sh gh run download -n flowpact-contracts ``` Or download it from the run's **Artifacts** section and unzip it in the repository root. ### Apply the patch [#apply-the-patch] ```sh git apply --index flowpact-contracts.patch # --index also stages new contract files rm -r flowpact-contracts.patch flowpact-contracts git commit -m "Update workflow contracts" ``` ### Review and commit [#review-and-commit] Check the changes; breaking ones are listed in the job summary. Then commit the updated contracts. The `patch` output holds the path of the patch on the runner, if a later step wants to use it (for example to push a commit). If the upload fails, the action logs a warning and goes on; the job summary then suggests `flowpact generate`. ## Monorepos and subdirectories [#monorepos-and-subdirectories] `working-directory` points flowpact at a folder that holds its own `.github` directory. Annotations, SARIF locations, the summary's links and the paths in the contract patch are all rewritten relative to the repository root, so they still point at the right files. `paths` and `config` are relative to `working-directory`; the report paths are relative to the workspace. Each step stages its drift artifact in its own folder and, unless `artifact-name` is set, names it after `working-directory`, so several flowpact steps in one job do not overwrite each other. Artifact names must be unique within a run: in a matrix over projects, set `artifact-name` from the matrix (for example `flowpact-contracts-${{ matrix.project }}`). Plugins listed in the config are JavaScript modules from the repository being analyzed, executed inside the action with the job's environment. Never enable them (`plugins: true`) on untrusted code that runs with secrets or a write token — for example `pull_request_target` workflows that check out the pull request head. With the default `auto`, the action skips them on `pull_request_target` and `workflow_run`. ## Debug logging [#debug-logging] The log of the flowpact step starts with a banner (tool and schema versions and the Node.js version), then shows the root, the config file and short progress lines in a collapsible group. These are log lines, not annotations. For more detail: - set the `debug` input to `true`: flowpact prints its debug logs (config resolution, every file parsed, matrix expansion, timing per rule) as ordinary log lines; or - **re-run the job with debug logging enabled**: GitHub turns on step debug logging and flowpact sends the same logs to the debug log. `FLOWPACT_DEBUG=1` in the step's `env` works too (`FLOWPACT_DEBUG=trace` for even more). Unexpected errors are reported with a stack trace when debug logging is on. ## Permissions [#permissions] - `contents: read` to check out the repository. With the `token` input, the action makes two kinds of request of its own, both optional: in [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) on a shallow checkout, a `git fetch` of the base commit from the repository itself; with `remotes: fetch`, GitHub API reads of the remote workflows and actions the [lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) lacks, for which the token needs read access to those repositories' contents. [Security](https://ciatlas.github.io/flowpact/docs/security#network-and-telemetry) lists every request flowpact makes. - Uploading the contract drift artifact needs no extra permission. - `security-events: write` on the job that uploads SARIF to code scanning (private repositories also need `actions: read` for that upload). Pull requests from forks get a read-only token, so the SARIF upload only works for branches in the repository itself. # API (https://ciatlas.github.io/flowpact/docs/api) The `flowpact` npm package is also a library. It has one function per CLI command, and the CLI is built on these functions, so both give the same results. Use it to run flowpact inside your own program, such as your organization's own [JavaScript action](#write-your-own-action). ```sh npm install --save-exact flowpact@0.29 ``` ```js import { lint } from 'flowpact'; const analysis = await lint({ root: 'path/to/repository' }); console.log(`${analysis.report.summary.errors} error(s)`); process.exitCode = analysis.exitCode(); ``` - The package is an ES module (`import`, not `require()`) for Node.js 22 or later. Its types are included, and it has no dependencies. - Options are the command's flags in camelCase. Relative paths in options are read from the working directory, like the flags; `paths` are relative to `root`. - The functions print nothing and never exit. They return their results, and throw a [`FlowpactError`](#errors) for a problem with the options, the config or a plugin. - Nothing is logged unless you pass `log`. ## Functions [#functions] | Function | Command | Returns | | --- | --- | --- | | `lint(options?)` | `flowpact lint` | [`Analysis`](#analysis) | | `check(options?)` | `flowpact check` | `Analysis`, with `contracts` | | `impact(options?)` | `flowpact impact` | `Analysis`, with `impact` | | `generate(options?)` | `flowpact generate` | [`ContractGeneration`](#generate) | | `graph(options?)` | `flowpact graph --format json` | [`CallGraph`](#graph-trace-rules-and-explain) | | `trace(options)` | `flowpact trace --format json` | `TraceResult` | | `rules(options?)` | `flowpact rules --format json` | `RuleInfo[]` | | `explain(codeOrName, options?)` | `flowpact explain` | `RuleDocs` | | `remotesUpdate(options?)` | `flowpact remotes update` | [`RemotesUpdateResult`](#remotesupdate-remotesdownload-and-remotesclean) | | `remotesDownload(options?)` | `flowpact remotes download` | `RemotesDownloadResult` | | `remotesClean(options?)` | `flowpact remotes clean` | `RemotesCleanResult` | Each returns a promise. `flowpact lsp` has no function: editors start the language server through the CLI. What the commands print in the terminal comes from these results: `pretty()` and the other methods of an `Analysis`, and the [format functions](#text) for the rest. Every function takes these options: | Option | Flag | Description | | --- | --- | --- | | `root` | `--root` | Repository root. Default: the working directory. | | `config` | `--config` | Config file. Default: `.github/flowpact/flowpact.config.yml` under the root, when it exists. | | `baseConfig` | `--base-config` | [Organization defaults](https://ciatlas.github.io/flowpact/docs/integrating#organization-defaults) under the repository's config. | | `plugins` | `--plugin` | Plugins to load besides those the config lists, such as your [organization rules](https://ciatlas.github.io/flowpact/docs/integrating#organization-rules). `repositoryPlugins` does not affect them. | | `repositoryPlugins` | `--no-plugins` | `false` skips the plugins the config lists, which run the repository's code. Default: `true`. | | `log` | `--debug`, `-v`, `-q` | `{ level, write(record) }`: receives each log record at `level` (default `info`) or above, with its `level`, `scope`, `message`, `data` and `time`. Like an error's, a record's `message` is written for people and can name the CLI's flags. | `graph`, `remotesUpdate` and `remotesDownload` take only `root`, `config`, `baseConfig` and `log` of these: they run no rules, so they load no plugins. `remotesClean` takes none of them: it works on the cache alone. ## lint, check and impact [#lint-check-and-impact] ```js import { check } from 'flowpact'; const analysis = await check({ paths: ['.github/workflows/deploy.yml'], only: ['FP401'] }); ``` | Option | Flag | Description | | --- | --- | --- | | `paths` | `[paths…]` | Workflow and action files or directories to report on, relative to the root. Default: all. In impact mode, only the published ones within them are graded ([Only some units](https://ciatlas.github.io/flowpact/docs/impact-mode#only-some-units)). | | `only` | `--only` | Rule codes or names to run. | | `schema` | `--no-schema` | `false` skips the validation against GitHub's workflow schema. Not for `impact`. | | `impact` | `--impact` | `lint` and `check`: also check the [release impact](https://ciatlas.github.io/flowpact/docs/impact-mode) of the changes. | | `base`, `expect`, `title`, `labels` | `--base`, `--expect`, `--title`, `--labels` | Impact mode's baseline and declared impact; `labels` is an array. In GitHub Actions, impact mode reads them from the pull request, as the CLI does. | | `now` | `FLOWPACT_NOW` | The current time, a `Date`, for the expiry of [overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides). | | `fetchRemotes` | `--fetch-remotes` | `lint` and `check`: fetch the interfaces of the remote workflows and actions the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) lacks, for this run only, and grade the [version changes](#version-changes). A reference that cannot be fetched is a warning in the log. | | `token`, `apiUrl` | `GH_TOKEN`, `GITHUB_API_URL` | With `fetchRemotes`: the token to read the remote repositories with, sent only to `apiUrl`. Default: `GH_TOKEN`, else `GITHUB_TOKEN`, else the GitHub CLI's; the API is `GITHUB_API_URL`, else github.com's. | | `githubCom` | `--github-com` | With `fetchRemotes` on GitHub Enterprise Server or GHE.com: also look on github.com for the references the enterprise server lacks, with `GITHUB_COM_TOKEN` or none, never `token`. | `impact()` runs only the impact rules, without the schema validation, as `flowpact impact` does. For lint's findings and the release impact in one run, call `lint({ impact: true })` (or `check`). Impact mode compares with the baseline commit, which must be in the clone: check out with `fetch-depth: 0`. On `merge_group` it is skipped (`notes` says so), and so it is when there is nothing to grade or to report on; `impact()` then reports nothing. ### Analysis [#analysis] | Member | Description | | --- | --- | | `report` | The [JSON report](https://ciatlas.github.io/flowpact/docs/cli#json-report): what `--format json` prints, as an object. | | `exitCode(failOn?)` | The CLI's exit code for `--fail-on` (`'error'` by default, `'warning'` or `'never'`): `1` when there are findings at that level, or unless it is `'never'`, when a [version change](#version-changes) breaks a call; else `0`. | | `annotations({ pathPrefix }?)` | One [annotation](https://ciatlas.github.io/flowpact/docs/action#annotations) per finding, for `@actions/core`'s `error()`, `warning()` and `notice()`: `level`, `message`, `title`, `file`, `startLine`, `endLine`, and for a finding on one line `startColumn` and `endColumn`. | | `github({ pathPrefix }?)` | The annotations as GitHub workflow commands (`--format github`), one line each: printed in a GitHub Actions step, they annotate the run and the pull request, without `@actions/core`. | | `sarif({ pathPrefix }?)` | SARIF 2.1.0 for code scanning, as text. | | `markdown(options?)` | The Markdown report, for job summaries and pull request comments. Options: `title`, `maxFindings` (default 50), `repoUrl` and `sha` (to link locations to the files at that commit), `includeGraph`. When a [version change](#version-changes) was graded or could not be fetched, it ends with the Version changes section of the action's job summary. | | `json({ includeGraph }?)` | The JSON report as `--format json` prints it. | | `pretty(options?)` | The terminal report, followed by the [version changes](#version-changes) when one was graded or could not be fetched. Options: `color`, `width` (default 100), `ascii`, `hideInfo`, `hyperlinks`. | | `contracts` | `check` only: `drift`, `breaking`, and `patch()`, the regenerated contracts as a patch for `git apply` when they drifted (`--patch`). | | `impact` | Impact mode's verdict, as in the report: `required`, `declared`, `ok`, `changes` and `baseline`, with `paths`, `scope`, and when `ignore` left out published units, `ignored`. | | `versionChanges` | `lint` and `check` with `fetchRemotes`: the remote references the change moves to another version, graded ([Version changes](#version-changes)). | | `notes` | What the CLI prints as `impact: …` lines: impact mode skipped, notes about its baseline and how it graded, and the paths it does not refuse though they name no workflow or action. With `fetchRemotes`, also `version changes: …` lines: why they were not graded. | `pathPrefix` is the root relative to the repository, when the root is a subdirectory of it. GitHub resolves annotation and SARIF paths against the repository; flowpact reports them relative to the root. `pretty()` and `markdown()` are safe to print in a GitHub Actions log, like the [text](#text) of the other commands. ### Version changes [#version-changes] With `fetchRemotes`, `lint` and `check` also grade the remote references the change moves to another version (`octo/setup@v2` → `@v3`) against the repository's calls, as `--fetch-remotes` and the action's `remotes: fetch` do ([On a pull request](https://ciatlas.github.io/flowpact/docs/remote-interfaces#on-a-pull-request)). The base is `base`, else in GitHub Actions the pull request's base commit. The API fetches no commits, so the base must be in the clone (check out with `fetch-depth: 0`); when it is not, `notes` says so. Without a base, and on `pull_request_target` and `workflow_run`, whose checkout may be untrusted, nothing is graded. `versionChanges` has the `base` commit, the `changes` (each `{ ref, from }`), their `grades` (the `grades` of [`remotesUpdate()`](#remotesupdate-remotesdownload-and-remotesclean)), and `failed`, the references that could not be fetched. As the CLI and the action fail on a version change that breaks a call, `exitCode()` returns `1` for one, unless `failOn` is `'never'`. `pretty()` and `markdown()` list the grades; the other reports are about the findings only. ## generate [#generate] ```js import { writeFile } from 'node:fs/promises'; import { generate } from 'flowpact'; const result = await generate({ dryRun: true }); if (result.drift) await writeFile('contracts.patch', result.patch()); ``` The options are `paths`, `dryRun` (`--dry-run`) and `out` (`--out`); for `--patch`, run with `dryRun` and write `patch()` yourself. The result has: - `drift` and `breaking`: whether any contract changes, and how many of the changes are breaking; - `counts` and `entries`: each contract file with its status (`create`, `update`, `delete`, `unchanged`) and changes; - `dryRun`: whether nothing was written (the option); - `written`: the files written, relative to the root (or to `out`); none with `dryRun`; - `skipped`: workflows and actions with YAML syntax errors, whose contracts were kept; - `patch()`: the changes as a patch for `git apply`, or `undefined` when nothing changes. Like the CLI, `generate` refuses to write through a symlink or out of the repository. ## graph, trace, rules and explain [#graph-trace-rules-and-explain] They return what the command prints as JSON: ```js import { explain, graph, rules, trace } from 'flowpact'; const { nodes, edges } = await graph(); const { traces } = await trace({ symbol: 'pipeline.yml#inputs.config', up: true, depth: 5 }); const enabled = (await rules()).filter((rule) => rule.severity !== 'off'); const { summary, why, fix, docsUrl } = await explain('FP401'); ``` - `graph({ paths })`: `nodes` (workflows, actions, remote workflows, missing targets) and `edges`, who calls whom `via` which job or step; with `paths`, only those workflows and actions (`roots`) and what they call and use. - `trace({ symbol, up, depth })`: one tree per matching symbol, as in [`flowpact trace`](https://ciatlas.github.io/flowpact/docs/cli#flowpact-trace); for a workflow or action without inputs, secrets or outputs, `traces` is empty and `unit` names it. - `rules()`: each rule's `code`, `name`, `category`, `defaultSeverity`, `severity` after the config, `summary` and `docsUrl`. - `explain(codeOrName)`: the same for one rule, with `why`, `fix`, `examples` and `generatedFiles`, and `scope` when the rule has one. ## remotesUpdate, remotesDownload and remotesClean [#remotesupdate-remotesdownload-and-remotesclean] The [remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) commands, for a program that keeps a repository's lockfile current, such as your own bot or a step after Renovate's update: ```js import { formatRemotesUpdate, remotesUpdate } from 'flowpact'; const result = await remotesUpdate({ root: 'path/to/repository', cacheDir: false }); console.log(formatRemotesUpdate(result)); if (result.failed.length) process.exitCode = 1; if (result.changes) { // Commit result.file (.github/flowpact/remotes.lock.yaml). } ``` - `remotesUpdate(options)`: `paths`, `dryRun`, `token`, `apiUrl`, `githubCom`, `cacheDir` and `onProgress`. The token is `GH_TOKEN`, else `GITHUB_TOKEN`, else the GitHub CLI's, unless you pass one, and is sent only to `apiUrl` (`GITHUB_API_URL`, else github.com's API). `cacheDir` is flowpact's cache directory (as `--cache-dir`), or `false` to keep none (`--no-cache`); by default it is `FLOWPACT_CACHE_DIR`, else none in CI, else the per-user cache. `onProgress(progress)` is called as each reference is done, with `done`, `total`, `ref`, `outcome` and `detail`. The result has `file` (the lockfile), `changes`, `added`, `changed` and `removed`, `failed` and `unreadable` (each `{ ref, error, kind }`, `kind` being `unreachable`, `timeout`, `token`, `access`, `rate-limit`, `server`, `not-found`, `too-large` (a file over 1 MB), `digest` or `other`), `apiUrl` (the API it read), `tokenSource` (where the token came from, never the token), `hints` (what to check, when references could not be read) with `guide` (where to point flowpact, when the API or the token may be the wrong one), and `sources` (the cache's `dir`, and files `written`, older commits `removed`, files `notKept` with why) or `sourcesNotKept`. `grades` has each changed entry graded against the repository's calls: its `ref`, `commits`, `verdict` (`breaks`, `unchecked` or `fits`), the interface `changes`, and its `calls`, each with `call` (where it is), `verdict`, the findings it `added` and `removed`, why it is `unchecked`, and `notes` (see [When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes)). `actionsLock`, when the repository has GitHub's `actions.lock`, has its `file`, how many references were read at the commits it `pinned`, or the `error` that kept it from being used. - `remotesDownload(options)`: the same options but `dryRun`, with `cacheDir` a directory. The result has `downloaded`, `cached`, `notLocked`, `skipped` (`{ ref, reason }`), `failed` (`{ ref, error }`, with `kind` when downloading failed and `cache: true` when writing the cache did), the cache's `dir`, the older commits `removed`, and `apiUrl`, `tokenSource`, `hints` and `guide` as `remotesUpdate`'s. Without a lockfile, or with one it cannot use, it throws a usage error. - `remotesClean({ cacheDir, keep })`: removes the cached commits, or keeps the `keep` most recently used of each repository. The result has `dir`, `keep`, `removed`, and `failed` when a commit could not be removed. As with the CLI, a reference that cannot be fetched is in the result, not thrown: check `failed`. The functions make requests to the GitHub API and, but for `dryRun`, write the lockfile and the cache; nothing else. ## Text [#text] What the commands print, from what the functions return: the same text as the CLI's for the same options. ```js import { formatGraph, formatTrace, graph, terminalOptions, trace } from 'flowpact'; const calls = await graph(); console.log(formatGraph(calls, terminalOptions())); // the tree `flowpact graph` prints in this terminal const diagram = formatGraph(calls, { format: 'mermaid' }); // for a job summary, in a mermaid code block console.log(formatTrace(await trace({ symbol: 'pipeline.yml#inputs.config' }))); ``` | Function | Prints what | | --- | --- | | `formatGraph(graph, options?)` | `flowpact graph`. `format`: `tree` (default), `mermaid` (without code fences) or `dot`. | | `formatTrace(result, options?)` | `flowpact trace` | | `formatRules(rules, options?)` | `flowpact rules` | | `formatExplain(rule, options?)` | `flowpact explain` | | `formatGeneration(generation, options?)` | `flowpact generate`: what was written, or after a `dryRun`, what would be. `diff: true` adds the diff, as `--dry-run` prints it. | | `formatRemotesUpdate(result, options?)` | `flowpact remotes update` | | `formatRemotesDownload(result, options?)` | `flowpact remotes download` | | `formatRemotesClean(result, options?)` | `flowpact remotes clean` | For the reports of `lint`, `check` and `impact`, use the [`Analysis`](#analysis) methods: `pretty()` is `--format pretty`. - The options are those of `pretty()` except `hideInfo`: `color`, `width` (default 100), `ascii` and `hyperlinks`. The functions never look at the terminal: without options, the text has no colors, and what wraps (rules, explanations and `pretty()`) wraps at 100 columns. That is the text for files and job summaries. - `terminalOptions()` is for text printed to the standard output: it returns what the CLI would use there. Colors are off with `NO_COLOR` or `FORCE_COLOR=0` and on with `FORCE_COLOR`; otherwise they are on in a terminal and in CI (on GitHub Actions runners too). The width is the terminal's, else `COLUMNS`, from 40 to 140 columns. - `graph`, `trace` and `rules` results are plain data, so JSON that the CLI printed with `--format json` renders as well. - Like the CLI's output, the text is safe to print in a GitHub Actions log: no line of it is read as a workflow command, whatever names the workflows use. `github()` is the exception by design: its lines are workflow commands, with every value escaped. - The text is written for people: its wording can change in any minor release. A program reads the results instead. ## Errors [#errors] ```js import { FlowpactError, lint } from 'flowpact'; try { await lint(); } catch (err) { if (!(err instanceof FlowpactError)) throw err; console.error(`${err.kind}: ${err.message}`, err.issues); } ``` A `FlowpactError` is what the CLI reports with exit code `2`. Act on its `kind`; the `message` is written for people and can name the CLI's flags. `issues` lists the individual problems (one per invalid config entry), and `file` names the config file when there is one. | `kind` | What went wrong | | --- | --- | | `usage` | An option or path that cannot work: a path that does not exist, a root without workflows, a rule `explain` does not know, a symbol `trace` cannot find. | | `config` | The config or base config is invalid, or names a rule that does not exist. So does an unknown rule in `only`. | | `plugin` | A plugin is missing, fails to load, exports no rules or registers an invalid rule. | | `unsafe-path` | `generate` refused to write through a symlink or out of the repository. | | `impact-setup` | Impact mode has no baseline, or cannot read it. | Any other error is a bug ([report it](https://github.com/ciatlas/flowpact/issues)) or a plugin rule that threw. ## TypeScript [#typescript] The package's types describe the options and results above, the report (`Report`, `Finding`, `Loc`, `Severity`) and `Annotation`. They also type [plugin rules](https://ciatlas.github.io/flowpact/docs/custom-rules): a type-only import keeps the compiled plugin free of imports, so it loads wherever flowpact runs. ```ts title="rules/acme.ts" import type { RuleDefinition } from 'flowpact'; const prodNeedsApproval: RuleDefinition = { code: 'ACME601', name: 'prod-deploy-needs-approval', category: 'structure', defaultSeverity: 'error', docsUrl: 'https://wiki.acme.dev/ci/ACME601', docs: { summary: '…', why: '…', fix: '…' }, check(ctx) { for (const wf of ctx.index.project.workflows.values()) { // … } }, }; export default [prodNeedsApproval]; ``` `defineRule(rule)` does the same as a function that returns the rule, for a plugin that has flowpact installed where it runs. Compile the plugin to JavaScript before listing it: flowpact loads plugins with Node's `import()`. `ctx.index`, the data-flow graph, follows flowpact's internals: its types can change in any minor release, without the notice the rest of the API gets. Use the members listed in [Custom rules](https://ciatlas.github.io/flowpact/docs/custom-rules#what-a-rule-can-use). ## Write your own action [#write-your-own-action] A JavaScript action of your own runs flowpact with your defaults, rules, inputs and reports, where your policy allows only your organization's actions. It uses no other actions and installs nothing when it runs: the bundle holds flowpact and `@actions/core`. ```text acme/flowpact-action ├── action.yml ├── src/main.js ├── build.mjs ├── dist/index.mjs # the bundle, committed ├── acme.base.yml # organization defaults └── rules/acme.mjs # organization rules ``` ```sh npm install --save-exact flowpact@0.29 @actions/core npm install --save-dev esbuild node build.mjs # after every update; commit dist/index.mjs ``` `acme.base.yml` and `rules/acme.mjs` are the [base config](https://ciatlas.github.io/flowpact/docs/integrating#organization-defaults) and the [plugin](https://ciatlas.github.io/flowpact/docs/custom-rules) of [Roll it out across an organization](https://ciatlas.github.io/flowpact/docs/integrating). ```yaml title="action.yml" name: Acme flowpact description: flowpact with Acme's defaults, rules and reports inputs: command: description: lint, or check when the repository commits contracts default: lint impact: description: Also check the release impact of changes to published workflows and actions default: 'false' fail-on: description: Fail the step on findings at this level (error, warning or never) default: error token: description: Reads the remote workflows and actions the remote interfaces lockfile lacks default: ${{ github.token }} sarif: description: Write SARIF for code scanning (its path is the sarif output) default: 'true' outputs: report-json: description: The JSON report, for actions/upload-artifact sarif: description: The SARIF file, for github/codeql-action/upload-sarif errors: description: Number of errors warnings: description: Number of warnings patch: description: The regenerated contracts as a patch, when they drifted (check) runs: using: node24 main: dist/index.mjs ``` ```js title="src/main.js" import { writeFileSync } from 'node:fs'; import { join } from 'node:path'; import * as core from '@actions/core'; import { check, FlowpactError, lint } from 'flowpact'; // This file runs as dist/index.mjs; the defaults and rules ship next to it, in the action's directory. const action = join(import.meta.dirname, '..'); // Events that run a fork's code with secrets: the repository's own plugins would run its code, and fetching would let // it choose which repositories the token reads. const UNTRUSTED = ['pull_request_target', 'workflow_run']; try { const workspace = process.env.GITHUB_WORKSPACE ?? process.cwd(); const trusted = !UNTRUSTED.includes(process.env.GITHUB_EVENT_NAME ?? ''); // lint (or check) with impact: lint's rules and the release impact in one run. impact() runs only the impact rules. const run = core.getInput('command') === 'check' ? check : lint; const analysis = await run({ root: workspace, baseConfig: join(action, 'acme.base.yml'), plugins: [join(action, 'rules/acme.mjs')], repositoryPlugins: trusted, impact: core.getBooleanInput('impact'), // The interfaces the remote interfaces lockfile lacks, read with the token for this run; on a pull request, the // references it moves to another version are graded too (analysis.versionChanges). fetchRemotes: trusted, token: core.getInput('token'), log: { level: 'warn', write: (record) => core.info(`${record.level}: ${record.message}`) }, }); // Why impact mode was skipped, its baseline, and why version changes were not graded. for (const note of analysis.notes) core.info(note); // An annotation on the file and line of each finding. for (const { level, message, ...properties } of analysis.annotations()) { if (level === 'error') core.error(message, properties); else if (level === 'warning') core.warning(message, properties); else core.notice(message, properties); } // The Markdown report as the job summary, with the version changes, linking to the files at this commit. const { GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_SHA } = process.env; const repoUrl = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}`; await core.summary.addRaw(analysis.markdown({ title: 'Acme flowpact', repoUrl, sha: GITHUB_SHA })).write(); // The JSON report, SARIF for code scanning, and the regenerated contracts as a patch when they drifted (check). They // go to RUNNER_TEMP, not the checkout, where a pull request could have committed a symlink in their place. const json = join(process.env.RUNNER_TEMP, 'flowpact.json'); writeFileSync(json, analysis.json()); core.setOutput('report-json', json); if (core.getBooleanInput('sarif')) { const file = join(process.env.RUNNER_TEMP, 'flowpact.sarif'); writeFileSync(file, analysis.sarif()); core.setOutput('sarif', file); } const patch = analysis.contracts?.patch(); if (patch) { const file = join(process.env.RUNNER_TEMP, 'flowpact-contracts.patch'); writeFileSync(file, patch); core.setOutput('patch', file); } const { errors, warnings } = analysis.report.summary; core.setOutput('errors', errors); core.setOutput('warnings', warnings); // Findings at fail-on fail the step, and so does a version change that breaks a call, unless fail-on is never. const breaks = analysis.versionChanges?.grades.some((g) => g.verdict === 'breaks'); if (analysis.exitCode(core.getInput('fail-on')) === 1) core.setFailed(`flowpact found ${errors} error(s) and ${warnings} warning(s)${breaks ? '; a version change breaks a call' : ''}`); } catch (err) { // A config, plugin or path problem: its message and each issue. Anything else is a bug, with its stack. if (!(err instanceof FlowpactError)) throw err; core.setFailed([err.message, ...err.issues.map((issue) => ` - ${issue}`)].join('\n')); } ``` ```js title="build.mjs" import { build } from 'esbuild'; await build({ entryPoints: ['src/main.js'], bundle: true, platform: 'node', format: 'esm', target: 'node24', // .mjs: an ES module whatever package.json the action's repository has. outfile: 'dist/index.mjs', // Some of @actions/core's dependencies are CommonJS and call require(). banner: { js: "import { createRequire } from 'node:module';\nconst require = createRequire(import.meta.url);" }, }); ``` From one run, this gives the annotations, the job summary with the version changes, the JSON report for `actions/upload-artifact` (the `report-json` output), the SARIF file for `github/codeql-action/upload-sarif` (the `sarif` output), a failed step at `fail-on` or on a version change that breaks a call, the patch when contracts drifted, and the counts as outputs. Repositories use it after `actions/checkout`: ```yaml title=".github/workflows/flowpact.yml" on: pull_request permissions: contents: read jobs: flowpact: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 # pin to a commit SHA with: fetch-depth: 0 # the base, for impact mode and version changes persist-credentials: false - uses: acme/flowpact-action@ id: flowpact with: impact: true - uses: actions/upload-artifact@v7 # pin to a commit SHA if: ${{ !cancelled() && steps.flowpact.outputs.report-json != '' }} with: name: flowpact-report path: ${{ steps.flowpact.outputs.report-json }} ``` The token reads public repositories; private and internal ones need a token that can read them, such as a GitHub App installation token passed as `token` ([Which token](https://ciatlas.github.io/flowpact/docs/remote-interfaces#which-token)). - [`@vercel/ncc`](https://github.com/vercel/ncc) works as well when the action's `package.json` has `"type": "module"` (`npm init` writes `"commonjs"`, and ncc then fails with `'import' and 'export' may appear only with 'sourceType: module'`). `ncc build src/main.js -o dist` writes `dist/index.js` and a `dist/package.json` that marks it as an ES module; commit both, and point `main` at `dist/index.js`. - A bundler's license report lists flowpact as one package. flowpact's own notices and SBOM list what it bundles: copy `node_modules/flowpact/dist/THIRD_PARTY_LICENSES.txt` and `sbom.cdx.json` next to yours. - When flowpact is updated (Renovate or Dependabot, as in [Keeping it current](https://ciatlas.github.io/flowpact/docs/integrating#keeping-it-current)), rebuild and commit the bundle. A CI job that rebuilds it and fails on a difference keeps the committed bundle in step with the source. ## Stability [#stability] The API follows the same policy as the CLI: only a major release changes it in an incompatible way, and says so under **Breaking changes** in its release notes; minor and patch releases never do. `RuleContext.index` and the types it leads to are the exception above. See [Stability](https://ciatlas.github.io/flowpact/docs/stability) for every interface it covers. # CLI (https://ciatlas.github.io/flowpact/docs/cli) | Command | What it does | | --- | --- | | [`flowpact lint`](#flowpact-lint) | Analyze workflows and local actions and report findings. | | [`flowpact check`](#flowpact-check) | `lint` plus a comparison with the committed [contracts](https://ciatlas.github.io/flowpact/docs/contracts). | | [`flowpact impact`](#flowpact-impact) | Check that the release impact a pull request declares covers its changes to published workflows and actions. | | [`flowpact generate`](#flowpact-generate) | Write (or preview) the contracts. | | [`flowpact remotes update`](#flowpact-remotes-update) | Fetch the interfaces of the remote workflows and actions this repository (or the given workflows and actions) uses into the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces). | | [`flowpact remotes download`](#flowpact-remotes-download) | Download the sources of the commits the lockfile pins into the [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor), for the editor. | | [`flowpact remotes clean`](#flowpact-remotes-clean) | Empty the sources cache, or keep the most recently used commits of each repository. | | [`flowpact graph`](#flowpact-graph) | Show the call graph of workflows and actions. | | [`flowpact trace`](#flowpact-trace) | Follow a value down to where it is used, or up to where it comes from. | | [`flowpact explain`](#flowpact-explain) | Print the docs for a rule. | | [`flowpact rules`](#flowpact-rules) | List the rules and their effective severities. | | [`flowpact lsp`](#flowpact-lsp) | Start the language server for editors. | Every command but `lsp` is also a function of the [API](https://ciatlas.github.io/flowpact/docs/api), for programs that run flowpact themselves. Options go after the command (`flowpact lint --no-plugins`); an option before it is a usage error. The value of an option is only ever that option's value, whatever it looks like: `--title "$PR_TITLE"` with a title of `--help` or `--plugin=x` is just a title. The analysis commands (`lint`, `check`, `impact`, `generate`, `trace`) start by printing the tool version and the version of every schema they read or write (to stderr, so JSON on stdout stays clean): ```text flowpact v0.29.2 config schema v1 · contract schema v1 · report schema v1 · node v24.4.0 root . · config .github/flowpact/flowpact.config.yml ``` `flowpact --version` prints the same line. ## `flowpact lint` [#flowpact-lint] Analyzes all workflows and local actions and reports findings. ```sh flowpact lint [paths…] [options] ``` | Option | Description | | --- | --- | | `[paths…]` | Files or directories to report on. Everything is still analyzed. With `--impact`, impact mode grades only the published workflows and actions within them (see [`flowpact impact`](#flowpact-impact)). | | `--root ` | Repository root (default: current directory). | | `--config ` | Config file (default: `.github/flowpact/flowpact.config.yml`). | | `--base-config ` | Defaults under the repository's config, such as an organization's, relative to the working directory. See [Base config](https://ciatlas.github.io/flowpact/docs/configuration#base-config). | | `--no-plugins` | Do not load the [plugins](https://ciatlas.github.io/flowpact/docs/custom-rules) the config lists; they run code from the repository. | | `--plugin ` | Also load this plugin, relative to the working directory; repeatable, and not affected by `--no-plugins`. See [organization rules](https://ciatlas.github.io/flowpact/docs/integrating#organization-rules). | | `--format pretty\|json\|markdown\|sarif\|github` | Output on stdout (default `pretty`). See [output formats](#output-formats). | | `-o, --output ` | Also write the report to a file, replacing it; format by extension: `.sarif` / `.sarif.json` → SARIF, `.json` → JSON, `.md` → Markdown, anything else → plain text. Name the format for other names, as in `-o markdown:"$GITHUB_STEP_SUMMARY"`. Repeat it to write several reports from one run. | | `--fail-on error\|warning\|never` | Exit `1` when findings at this level exist (default `error`), and unless `never`, when a version change that `--fetch-remotes` grades breaks a call. | | `--only ` | Comma-separated codes or names to run, e.g. `FP401,unused-input`. | | `--hide-info` | Pretty terminal output only: do not list info findings (they are still counted). JSON, Markdown and SARIF always include them. | | `--include-graph` | Add the data-flow graph to JSON output and the call graph (Mermaid) to Markdown output. | | `--dump-graph ` | Write the data-flow graph as JSON (debugging). | | `--no-schema` | Skip validation against GitHub's workflow schema. | | `--fetch-remotes` | Fetch the interfaces of the remote workflows and actions the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces) lacks, for this run only (nothing is written), with `GH_TOKEN`, `GITHUB_TOKEN` or the GitHub CLI's token. It says which API and token it uses and shows its progress on stderr, as [`remotes update`](#flowpact-remotes-update) does. A reference that cannot be fetched is a warning, followed by what to check. On a pull request in GitHub Actions, or with `--base `, it also grades the remote references the change moves to another version ([On a pull request](https://ciatlas.github.io/flowpact/docs/remote-interfaces#on-a-pull-request)). | | `--impact` | Also check the release impact of the changes against the declared impact, with `--base `, `--expect none\|patch\|minor\|major`, `--title ` and `--labels `. See [`flowpact impact`](#flowpact-impact). | | `-d, --debug` | Debug logging (see below). | | `-v` / `-vv` | Verbose / trace logging. | | `-q, --quiet` | No banner or logs, only the report and errors. | | `--no-color` | Disable colors (also `NO_COLOR=1`). | | `--ascii` | ASCII-only symbols for limited terminals. | The summary card at the end: ### Output formats [#output-formats] | Format | Use it for | | --- | --- | | `pretty` | The terminal: code frames, call chains, matrix combinations and a summary card. | | `json` | Tooling. Follows [`/schemas/report/v1.json`](https://ciatlas.github.io/flowpact/schemas/report/v1.json) (below). | | `markdown` | Job summaries and pull request comments: counts, findings grouped by severity with docs links, and contract changes in `flowpact check`. Inside GitHub Actions, locations link to the file at the commit being checked. | | `sarif` | [SARIF 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) for GitHub code scanning and other SARIF viewers. Findings accepted by overrides and ignore comments are left out (code scanning ignores SARIF suppressions); the JSON report lists them under `suppressed` and `ignoredByComment`. | | `github` | GitHub Actions: one [workflow command](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands) per finding, which GitHub shows as an error, warning or notice annotation on the file and line, in the run and the pull request — the same annotations as the [action](https://ciatlas.github.io/flowpact/docs/action#annotations). Stdout only. | Inside GitHub Actions, when `--root` is a subdirectory of the repository, the paths in `github` annotations, SARIF and the Markdown links are made relative to the repository (`GITHUB_WORKSPACE`), where GitHub resolves them. ```sh flowpact lint -o flowpact-report.json # JSON file + pretty output in the terminal flowpact lint -o flowpact.sarif # SARIF file for code scanning flowpact lint -o flowpact-report.md # Markdown file, e.g. for $GITHUB_STEP_SUMMARY flowpact lint -o flowpact-report.txt # plain-text copy of the pretty report flowpact lint --format json > report.json # JSON only # In GitHub Actions: annotations, the job summary and SARIF, from one run flowpact lint --format github -o markdown:"$GITHUB_STEP_SUMMARY" -o flowpact.sarif ``` ### JSON report [#json-report] The JSON report follows [`/schemas/report/v1.json`](https://ciatlas.github.io/flowpact/schemas/report/v1.json): ```json { "$schema": "https://ciatlas.github.io/flowpact/schemas/report/v1.json", "meta": { "tool": "flowpact", "version": "0.29.2", "schemas": { "config": 1, "contract": 1, "report": 1 }, "node": "v24.4.0", "platform": "linux-x64", "root": "/home/runner/work/app/app", "durationMs": 31 }, "summary": { "errors": 1, "warnings": 0, "infos": 0, "suppressed": 0, "ignoredByComment": 0, "byCode": { "FP401": 1 } }, "findings": [ { "code": "FP401", "name": "empty-binding-for-matrix-combo", "severity": "error", "message": "Input \"config\" for .github/workflows/run-suite.yml is empty in 1 of 3 matrix combinations — matrix.config is not defined there", "loc": { "file": ".github/workflows/tests.yml", "line": 23, "column": 19, "endLine": 23, "endColumn": 32 }, "related": [{ "loc": { "file": ".github/workflows/tests.yml", "line": 18, "column": 13 }, "message": "this include entry has no `config`" }], "combos": ["{ name: windows }"], "symbol": ".github/workflows/run-suite.yml#inputs.config", "why": "…", "fix": "…", "docsUrl": "https://ciatlas.github.io/flowpact/docs/rules/fp401", "fingerprint": "3f2a9c0d81b7e645" } ], "suppressed": [], "ignoredByComment": [], "rules": [{ "code": "FP101", "name": "missing-required-input", "severity": "error" }, "…"] } ``` - `symbol` identifies what the finding is about; use it as the `target` of an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides). - `suppressed` lists findings accepted by overrides, each with an `override` object (`index`, `reason`, `expires`, `owner`); they are not part of the counts. - `ignoredByComment` lists findings accepted by [ignore comments](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments), each with a `comment` object (`loc`, and `reason` when the comment gives one); they are not part of the counts either. - In `flowpact check`, `contracts` holds the contract comparison: `drift`, the number of `breaking` changes, `counts` per status and one entry per contract file with its status and semantic changes. - `fingerprint` is stable across unrelated edits (line shifts, changed counts), so it can be used to track findings over time. - `suggestions`, on some findings, are fixes flowpact can apply: each has a `title` and the `edits` that make it, the text at `loc` replaced by `newText`. A rule suggests one only when the change is certain: - rename a misspelled input, secret, output or step id to the name its "did you mean" points at; - add a missing required input or secret to a call (`with:`, `secrets:`), or a missing key to the matrix `include` entries that lack it, with an empty value for you to fill in; - remove an unused input, and what local callers pass for it, from a workflow or action no other repository uses (not a [published](https://ciatlas.github.io/flowpact/docs/concepts#published-unit) one, nor a dispatch input, whose callers flowpact cannot see). Nothing is suggested in a flow mapping (`{ … }`) or a file with CRLF line endings. The editor offers suggestions as quick fixes, and SARIF carries them as `fixes`. ```json "suggestions": [ { "title": "Rename \"confg\" to \"config\"", "edits": [{ "loc": { "file": ".github/workflows/ci.yml", "line": 6, "column": 7, "endLine": 6, "endColumn": 12 }, "newText": "config" }] } ] ``` - `rules` lists every rule with its code, name and effective severity (`off` included). - With `--impact` (or `flowpact impact`), `impact` holds the verdict: the `baseline`, the `required` and `declared` impact, `ok`, and every graded change. With paths, `impact.scope` lists the `paths` and the published `units` within them, the only ones graded; `impact.ignored` lists the published units `ignore` left out. See [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode). ## `flowpact check` [#flowpact-check] Everything `flowpact lint` does, plus a comparison with the [contracts](https://ciatlas.github.io/flowpact/docs/contracts) committed in `.github/flowpact/`. ```sh flowpact check [paths…] [options] [--patch ] ``` It takes the same options as `flowpact lint`. Contract findings — missing (`FP801`), outdated (`FP802`), breaking (`FP803`), orphaned (`FP804`) and invalid (`FP805`) contracts — are errors by default, so the command exits `1` until the contracts are regenerated. With `paths`, the comparison covers the contracts of those workflows and actions, and the contracts that list them as a consumer: a caller that stops passing an input or reading an output changes its callee's contract, so that drift is reported too. The orphaned contract of a workflow or action that no longer exists is covered when its path lies within the paths, such as `actions/` for a removed `actions/old` (with `--impact`, the removed path itself counts). | Option | Description | | --- | --- | | `--patch ` | When contracts drifted, also write a `git apply`-able patch with the regenerated contracts. | ## `flowpact generate` [#flowpact-generate] Writes the contract for every workflow and local action, and deletes contracts whose workflow or action no longer exists. ```sh flowpact generate [paths…] [--dry-run] [--patch ] [--out ] ``` | Option | Description | | --- | --- | | `[paths…]` | Workflow or action files or directories: write only their contracts and the contracts that list them as a consumer, and delete the orphaned contracts of removed units within them (what `flowpact check` with the same paths compares). Other contracts are left alone. | | `--dry-run` | Print the table of changes and a colored unified diff; write nothing. | | `--patch ` | Write the changes as a `git apply`-able patch instead of applying them. | | `--out ` | Write all contracts (changed or not) under ``, keeping their relative paths, instead of the repository. Nothing is deleted. | It also accepts `--root`, `--config`, `--base-config` and the logging and color options. The table lists every contract file as new, changed, removed or unchanged, with the semantic changes underneath; breaking changes are marked. Running it twice in a row changes nothing. ## `flowpact remotes` [#flowpact-remotes] The [remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) of the workflows and actions this repository calls from other repositories: `update` writes the lockfile, `download` fills the sources cache from it for the editor, and `clean` empties that cache. ### `flowpact remotes update` [#flowpact-remotes-update] Fetches the interface of every remote reusable workflow and action the repository uses, and writes `.github/flowpact/remotes.lock.yaml` (see [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces)). ```sh flowpact remotes update [paths…] [--cache-dir | --no-cache] [--dry-run] [--fail-on ] [--format json] ``` | Option | Description | | --- | --- | | `[paths…]` | Workflow or action files or directories: fetch only the remote references they use, and those of the local workflows and actions they call. Other entries of the lockfile are kept as they are; an entry nothing in the repository uses any more is still dropped. | | `--github-com` | On GitHub Enterprise Server or GHE.com: also look on github.com for the references the enterprise server lacks, as GitHub Connect does, with `GITHUB_COM_TOKEN` or none (never the enterprise token). See [GitHub Enterprise Server](https://ciatlas.github.io/flowpact/docs/remote-interfaces#github-enterprise-server-and-ghecom). | | `--cache-dir ` | flowpact's cache directory: keep the files read in its `remotes` directory (relative to where you run flowpact). Also in CI, where nothing is kept by default. | | `--no-cache` | Keep none of the files read; write only the lockfile. Not with `--cache-dir`. | | `--dry-run` | Fetch and say what would change; write nothing, not even to the cache. | | `--fail-on ` | Also exit `1` when a changed entry breaks a call of the repository (`breaks`), or breaks one or leaves part of one unchecked (`unchecked`). Default: `never`. See [When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes). | | `--format ` | `pretty` (the default) or `json`: the result as [`remotesUpdate()`](https://ciatlas.github.io/flowpact/docs/api#remotesupdate-remotesdownload-and-remotesclean) returns it. `remotes download` and `remotes clean` take it too. | It also accepts `--root`, `--config` and the logging and color options. Each reference is resolved to a commit through the GitHub API, and its workflow file or `action.yml` is read at that commit. Entries of references nothing uses any more are dropped. A reference that does not exist, or that the token cannot read, is listed as `unread` and, without a previous entry, recorded under the lockfile's `unreadable:`, so [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) counts it as accounted for. Any other failure (the network, a timeout, an error from the API, a file over 1 MB) is listed as `failed`, keeps the reference's previous entry, and makes the command exit `1`. A reference GitHub's [`actions.lock`](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock) pins is read at the commit it pins, not at the one its tag points to now; the output says how many were (`.github/workflows/actions.lock: 2 references read at the commits it pins`), or why that file is not used. Each entry that changed (its reference moved to another commit, or its interface changed) is graded against every call of the reference in the repository, also with paths: under the reference, the output lists the interface changes and each call the change breaks or leaves partly unchecked, with why (see [When a version changes](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-version-changes)). The token is `GH_TOKEN`, else `GITHUB_TOKEN`, else the GitHub CLI's for the API's host (`gh auth token --hostname`); the output names the source it used (`token: GH_TOKEN`), never the token, which is sent only to the GitHub API (`GITHUB_API_URL` on GitHub Enterprise Server). Public repositories can be read without one, at GitHub's 60 requests an hour for anonymous reads; private and internal ones need read access to their contents (fine-grained: **Contents: read** on them; classic: `repo`). Before the first request it says on stderr which API it reads, and where the token came from and what kind it is (or why there is none). In a terminal a spinner then shows the count, the time so far and any retry; `-d` logs each reference instead, and `-q` shows neither. Each failure says why, and the output ends with what to check: see [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces#when-a-reference-is-not-fetched). The files it reads go to the [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor), for the editor; the output names it (`sources: ~/.cache/flowpact/remotes (2 new)`). Files it cannot keep there are counted on that line, with the first reason (`-d` logs each one), and do not fail the command. With `--dry-run`, nothing is kept. In CI (`CI` set, or Azure Pipelines' `TF_BUILD`, or Jenkins' `JENKINS_URL`), nothing is kept unless `--cache-dir` or `FLOWPACT_CACHE_DIR` says where: nobody opens the files there, and the line says so. ### `flowpact remotes download` [#flowpact-remotes-download] Downloads the workflow files and `action.yml`s of the remote references the repository uses into the [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor), at the commits the lockfile pins, so the editor can open them. It resolves no tag and does not change the lockfile. ```sh flowpact remotes download [paths…] [--cache-dir ] [--github-com] ``` | Option | Description | | --- | --- | | `[paths…]` | Workflow or action files or directories: download only the sources of the remote references they use, and those of the local workflows and actions they call. | | `--cache-dir ` | flowpact's cache directory: download into its `remotes` directory (relative to where you run flowpact). | | `--github-com` | Download the sources of entries read on github.com (`host: github.com`), with `GITHUB_COM_TOKEN` or none; without it they are skipped. See [GitHub Enterprise Server](https://ciatlas.github.io/flowpact/docs/remote-interfaces#github-enterprise-server-and-ghecom). | It needs the lockfile (without one, or with one it cannot use, it exits `2`), and the same token and `GITHUB_API_URL` as `flowpact remotes update`. Unlike `remotes update`, it uses the cache in CI too: downloading is all it does. A source the cache has is not downloaded again. A reference the lockfile has no entry for is listed as `unlocked` (`flowpact remotes update` adds it), one it records as not readable as `skipped`. A source that cannot be downloaded or kept is listed as `failed`, and makes the command exit `1`. Both commands then keep the 3 most recently used commits of each repository in the cache, and every one they used; the output counts the older commits removed. See [`flowpact remotes clean`](#flowpact-remotes-clean) to clean more. ### `flowpact remotes clean` [#flowpact-remotes-clean] Removes the commits kept in the [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor). ```sh flowpact remotes clean [--keep ] [--cache-dir ] ``` | Option | Description | | --- | --- | | `--keep ` | Keep the `n` most recently used commits of each repository (used by `remotes update` or `remotes download`); without it, nothing is kept. | | `--cache-dir ` | flowpact's cache directory, as for `remotes update`. | It removes only the `///` directories flowpact keeps there, then the directories they leave empty; anything else in the directory stays. A commit it cannot remove is named in the output and makes it exit `1`. ## `flowpact graph` [#flowpact-graph] Shows which workflows call which reusable workflows and local actions. ```sh flowpact graph [paths…] [--format tree|mermaid|dot|json] ``` With paths (workflow or action files, or directories), the graph starts from those workflows and actions and shows only what they call and use, all the way down; every format draws the same part, and the JSON lists them as `roots`. The tree starts at them even when one is in a cycle. Without paths, it shows the whole repository. | Format | Output | | --- | --- | | `tree` (default) | A tree per top-level workflow in the terminal. | | `mermaid` | A Mermaid `flowchart`, rendered by GitHub in Markdown files, issues and pull requests. | | `dot` | Graphviz DOT, e.g. `flowpact graph --format dot \| dot -Tsvg > graph.svg`. | | `json` | Nodes and edges for tooling. | Edges are labelled with the calling job (`jobs.build`, or the step for local actions), `×N` when the call fans out over N matrix combinations, and `(inherit)` for `secrets: inherit`. Reusable workflows in other repositories appear as **remote** nodes, local targets that do not exist as **missing** nodes, and job-level calls to files outside `.github/workflows` ([`FP606`](https://ciatlas.github.io/flowpact/docs/rules/fp606)) as **invalid location** nodes. ## `flowpact trace` [#flowpact-trace] Shows where a value flows to, or with `--up` where it comes from. ```sh flowpact trace [--up] [--depth n] [--format pretty|json] ``` Each symbol is expanded once per trace; where the same value is reached again through another path (for example shared callees), the tree says `↑ shown above` instead of repeating it. `--format json` always prints `{ "query", "direction", "traces": [...] }`, however many symbols matched; for a workflow or action without inputs, secrets or outputs, `traces` is empty and `"unit"` names it. Symbols can be written in several ways: | Query | Matches | | --- | --- | | `.github/workflows/ci.yml#inputs.env` | exactly that symbol | | `ci.yml#inputs.env` | by file name | | `ci.yml:env` | inputs, secrets or outputs named `env` | | `ci.yml` | the whole interface of the workflow (every input, secret and output) | Under each branch, `via` shows how the value gets there: the expression it passes through, `workflow output` or `action output`, or `secrets: inherit`. A note in parentheses qualifies it where that matters: `(jobs.deploy)` names the job whose `secrets: inherit` passes a secret on, `(exposed to the caller)` marks an output of a reusable workflow or action that becomes the output of the job or step that uses it, and `(the default of inputs.)` and `(when dispatched)` are described in [Follow a value](https://ciatlas.github.io/flowpact/docs/tracing#how-values-are-followed). Upstream, each `◀` branch is a value the symbol is computed from, traced further up in turn. Where the trace ends, the tree says what it ends at: | Leaf | The value comes from | | --- | --- | | `literal` | a plain value: what a caller or a step passes, an env variable's or output's own value, or the input's `default:` when a caller or step omits the input | | `omitted` | nothing: a caller or step does not pass the input (the `default:` GitHub then uses, if any, is listed too) | | `value`, `missing`, `dynamic` | a matrix key: its value in each combination, a combination that does not define it, or a matrix computed at runtime | | `context` | a context flowpact does not follow: `github.event.pull_request.title`, `runner.os`, `needs..result`, `steps..outcome`, or an `env` variable set at runtime (`$GITHUB_ENV`). A value read from the step's own `env:` is followed to what that entry reads. | | `invalid` | an expression that does not parse ([`FP502`](https://ciatlas.github.io/flowpact/docs/rules/fp502) reports it), or, in an input's `default:`, a context or function GitHub does not allow there | | `expression` | an expression that reads no context, such as `format('v{0}', 1)` | How a trace reads inputs' defaults, the inputs of a workflow that is also dispatched, and whole objects such as `toJSON(inputs)`, with examples: [Follow a value](https://ciatlas.github.io/flowpact/docs/tracing#how-values-are-followed). ## `flowpact impact` [#flowpact-impact] For publishers of reusable workflows and actions: checks that the release impact a pull request declares covers the changes to published units since its base. See [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode). ```sh flowpact impact [paths…] --base origin/main --title "fix: tidy the test job" ``` It runs only the impact rules (`FP810`–`FP814`), so its exit code reflects only the verdict. `flowpact lint --impact` and `flowpact check --impact` add the verdict to everything else they report. Options: `--base`, `--expect`, `--title`, `--labels` and the output options of `lint`. With paths (workflow or action files, or directories), impact mode grades only the published workflows and actions within them, and the verdict is about those alone: the paths narrow the gate, so a change to a published unit outside them is not checked. A path the pull request removed counts when the baseline has a workflow or action there, whether it is given relative to `--root` or to the working directory. The same holds for `lint --impact` and `check --impact` with paths. See [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode#only-some-units). ## `flowpact explain` [#flowpact-explain] ```sh flowpact explain FP401 flowpact explain empty-binding-for-matrix-combo ``` ## `flowpact rules` [#flowpact-rules] Lists every built-in rule with its effective severity (after your config). `--format json` for tooling. ## `flowpact lsp` [#flowpact-lsp] Starts the language server, which speaks the Language Server Protocol over stdin/stdout (`--node-ipc` and `--socket ` are also accepted). Editors start it themselves; you do not run it by hand. It serves diagnostics as you type, hover traces, go to definition across workflow calls, and references. See [Editors](https://ciatlas.github.io/flowpact/docs/editors) for its settings and how to set it up in Neovim and other editors; the VS Code extension bundles it. ## Debug mode and logging [#debug-mode-and-logging] flowpact logs every stage of the analysis: config resolution, file discovery, parsing per file, graph construction, matrix expansion per job (combinations, keys, exactness), each rule with its finding count and timing, and the final summary. | Enable with | Level | | --- | --- | | `--debug`, `-d`, `-v`, `FLOWPACT_DEBUG=1` | debug | | `-vv`, `FLOWPACT_DEBUG=trace` | trace (adds per-file timings and skipped rules) | | `RUNNER_DEBUG=1`, `ACTIONS_STEP_DEBUG=true` | debug — set automatically when you re-run a GitHub job with debug logging | Logs go to stderr, so `--format json` output stays parseable. ## Exit codes [#exit-codes] | Code | Meaning | | --- | --- | | `0` | No findings at or above `--fail-on` (default: `error`). | | `1` | Findings at or above `--fail-on` — including contract findings in `flowpact check`. | | `2` | Usage or configuration error (unknown rule, invalid config, plugin that fails to load, nothing to analyze). | | `3` | Internal error — please [report it](https://github.com/ciatlas/flowpact/issues) with `--debug` output. | `flowpact graph`, `flowpact trace`, `flowpact explain` and `flowpact rules` exit `0` on success. `flowpact generate` exits `0` too, or `1` when a file with YAML syntax errors could not be regenerated (its committed contract is kept). ## Environment variables [#environment-variables] | Variable | Effect | | --- | --- | | `NO_COLOR` / `FORCE_COLOR` | Disable / force colors. | | `FLOWPACT_DEBUG` | `1` for debug logs, `trace` for trace logs. | | `FLOWPACT_NO_HYPERLINKS` | Disable clickable docs links (OSC 8). | | `GITHUB_REPOSITORY` | `owner/repo`, used to resolve same-repository `uses:` references (also read from `.git/config` or the `repository` config key). | | `GH_TOKEN` / `GITHUB_TOKEN` | The token `flowpact remotes update`, `remotes download` and `--fetch-remotes` read remote repositories with (else `gh auth token`). | | `GITHUB_API_URL` | The GitHub API `flowpact remotes update`, `remotes download` and `--fetch-remotes` use (`https:///api/v3` on GitHub Enterprise Server); `https://api.github.com` by default. | | `GITHUB_COM_TOKEN` | With `--github-com`, the token for github.com; without it, github.com is read without one. | | `FLOWPACT_CACHE_DIR` | An absolute path: keep the [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor) in its `remotes` directory instead of the platform's per-user cache, also in CI. `--cache-dir` takes precedence. | | `CI` / `TF_BUILD` / `JENKINS_URL` | Set by CI services: `flowpact remotes update` keeps no sources unless `--cache-dir` or `FLOWPACT_CACHE_DIR` says where. | | `COLUMNS` | Output width when not attached to a terminal. | # Security (https://ciatlas.github.io/flowpact/docs/security) flowpact is a static analyzer: it reads the workflow, action, config and contract files of a repository and reports on them. This page is for the people who review it before it runs in their organization. To report a vulnerability, see the [security policy](https://github.com/ciatlas/flowpact/security/policy). The [threat model](https://ciatlas.github.io/flowpact/docs/threat-model) goes further: it names what flowpact and its releases protect and where untrusted data and code cross into them, ranks the threats, and gives for each the code and tests that defend against it and the risk that remains. ## What it reads and writes [#what-it-reads-and-writes] - **Reads** the repository it analyzes: `.github/workflows/*.yml`, local actions (`action.yml`), the config (`.github/flowpact/flowpact.config.yml`), the contracts (`.github/flowpact/contracts/`) and the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces). With [impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode), it also reads the same files at the pull request's base commit through git. - **Writes** only what you ask for: reports to stdout or `--output`, contracts with `flowpact generate`, the remote interfaces lockfile with `flowpact remotes update`, and a patch with `flowpact check --patch`. `flowpact remotes update` and `remotes download` also keep the remote workflow and action files they read in a per-user [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor) outside the repository, for your user alone (not in CI unless asked, and never with `--dry-run`, `--fetch-remotes` or in the action). It never commits or pushes. - **The GitHub Action** additionally writes annotations, the job summary and its outputs, and, in `mode: check` when contracts drifted, uploads the regenerated contracts as a workflow artifact (`upload-contracts`). flowpact treats the analyzed files as untrusted input: - it never writes contracts, reports or patches through a symlink in the repository (or, in GitHub Actions, the workspace), which a pull request could commit; it writes outside the repository only to paths you pass, such as `-o markdown:"$GITHUB_STEP_SUMMARY"`, and to the sources cache, where every part of a path from the repository is checked to be a plain file name; - it escapes control characters in every finding, and keeps its output from being read as [workflow commands](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands) (`::…` at the start of a line, `##[…]` anywhere), except the annotations it prints on purpose with `--format github`; - it reads the value of a flag only as that flag: `--title "$PR_TITLE"` cannot add a `--plugin` or an `-o`, turn off `--no-plugins`, or end the run as `--help` would; - it caps matrix expansion and YAML alias expansion; - it only parses the remote workflow and action files it fetches, never runs them, and refuses one over 1 MB. Reports of a way around any of this are in scope of the [security policy](https://github.com/ciatlas/flowpact/security/policy). ## Network and telemetry [#network-and-telemetry] flowpact has **no telemetry** and sends nothing anywhere. - The language server and the VS Code extension make **no network requests**. - The CLI makes requests only when you ask it to fetch [remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces): `flowpact remotes update`, or `lint`/`check` with `--fetch-remotes`. It reads the remote repositories' workflow and action files from the GitHub API (`GITHUB_API_URL`, `https://api.github.com` by default), with `GH_TOKEN`, `GITHUB_TOKEN` or the GitHub CLI's token as the authorization header, sent to that API only and never printed. - The GitHub Action makes three kinds, all to GitHub and all optional: - in impact mode, when the checkout is shallow, a `git fetch` of the base commit (and, for release pull requests, the release tags) from the repository's own `origin`, with the `token` input as a one-off authorization header; - in `mode: check` with `upload-contracts`, the upload of the contract drift artifact, made the way `actions/upload-artifact` makes it: to the runner's artifact service, and the zip itself to the storage address that service signs for it. It uses the runner's own token for the artifact service, not the `token` input; - with `remotes: fetch`, GitHub API reads of the remote workflow and action files the lockfile lacks, with the `token` input, the same way as the CLI. Never on `pull_request_target` or `workflow_run`, where an untrusted pull request would choose which repositories the token reads. On GitHub Enterprise Server, the `git fetch` and the API reads go to the enterprise server, never to github.com, unless you opt in to looking on github.com for the actions it takes from there through GitHub Connect (`--github-com`, the action's `remotes-github-com`). Then the names of the references the enterprise server lacks go to github.com, read with `GITHUB_COM_TOKEN` (`github-com-token`) or no token; the enterprise token is never sent there. The artifact upload is not available there: the action warns that it could not upload the artifact and still writes the patch (the `patch` output). Set `upload-contracts: false` there. ## Permissions [#permissions] - **CLI and editor:** none beyond reading the repository. They run with the permissions of whoever runs them. - **GitHub Action:** `contents: read` to check out the repository. The action calls the GitHub API only with `remotes: fetch`, to read the remote workflows and actions a run uses: `github.token` reads public repositories; private and internal ones of the organization need a `token` that can read their contents. Uploading SARIF to code scanning is a separate step (`github/codeql-action/upload-sarif`) that needs `security-events: write`. See [action permissions](https://ciatlas.github.io/flowpact/docs/action#permissions). ## Plugins run code [#plugins-run-code] [Plugins](https://ciatlas.github.io/flowpact/docs/custom-rules) are JavaScript modules from the analyzed repository, listed in its config. They run with the permissions and environment of whatever runs flowpact. flowpact never downloads them. - The GitHub Action's `plugins: auto` (the default) skips them on `pull_request_target` and `workflow_run`, where the repository's code may come from an untrusted fork while the job holds secrets. Plugins named in its `plugin` input, such as an organization's rules in its [copy of the action](https://ciatlas.github.io/flowpact/docs/integrating#copy-the-action), still load, except a file in the checkout: that one is skipped like the config's plugins. - The VS Code extension loads them only in a [trusted workspace](https://ciatlas.github.io/flowpact/docs/editors#workspace-trust), and only for repositories inside the workspace folders. - The CLI loads the plugins the config lists unless you pass `--no-plugins`; pass it on code you do not trust. Plugins given with `--plugin`, such as the rules of a [wrapper](https://ciatlas.github.io/flowpact/docs/integrating#organization-rules), still load. If you do not use plugins, set `plugins: false` in the action. ## How releases are built [#how-releases-are-built] - **Built only by GitHub Actions**, from a tag, in this repository's [release workflow](https://github.com/ciatlas/flowpact/blob/main/.github/workflows/release.yml). Release tags (`v*`) can only be created or moved by the release automation and maintainers. Every workflow pins its actions to commit SHAs. - **npm:** published with npm trusted publishing (no long-lived token) and npm provenance. - **GitHub release assets:** the npm tarball, the VS Code extension (`.vsix`) and the GitHub Action as an archive (`flowpact-action-X.Y.Z.tar.gz`: `action.yml`, the bundle, its license notices and SBOM). Each is signed with a Sigstore bundle (`.sigstore.json`) and carries in-toto build provenance (`.intoto.jsonl`). - **What each artifact contains:** every bundle ships `THIRD_PARTY_LICENSES.txt` (each bundled package with its license text) and `sbom.cdx.json` (a CycloneDX SBOM). Each SBOM is also attested against its artifact (a CycloneDX attestation whose subject is the artifact), and the release attaches a copy (`flowpact-X.Y.Z.cdx.json`, `flowpact-action-X.Y.Z.cdx.json`, `flowpact-vscode-X.Y.Z.cdx.json`). flowpact's workflow model, `@ciatlas/core`, is built from its own repository's release tag rather than npm, and the SBOM names it so: `pkg:github/ciatlas/core@vX.Y.Z`. - **Published only once complete:** a release stays a draft until every signed asset and SBOM is attached, and a published release is never changed. - **Immutable:** from 0.10.0, every release is a GitHub [immutable release](https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases): once published, its tag and files cannot change, and GitHub signs a release attestation of the tag, the commit and every file. Drafting first and publishing only once every file is attached is the flow GitHub recommends for it. - **Reproducible:** the action's bundle is committed, and CI fails when building it from source gives different bytes. The action archive and the `.vsix` are built deterministically from the tag. The action archive, the SBOMs and draft releases start with 0.9.0. ## Verify a release [#verify-a-release] Download the assets of a release (`gh release download vX.Y.Z --repo ciatlas/flowpact`), then run the commands below. Releases up to 0.11.1 were built before the move, and GitHub keeps their attestations under the old owner: verify them online with `--owner rumankazi`, or offline against the bundle attached to the release with `gh attestation verify --bundle .sigstore.json --repo rumankazi/flowpact`. `gh release verify` no longer finds their release attestations. ```sh # Built by this repository's release workflow: gh attestation verify flowpact-X.Y.Z.tgz --repo ciatlas/flowpact gh attestation verify flowpact-action-X.Y.Z.tar.gz --repo ciatlas/flowpact gh attestation verify flowpact-vscode-X.Y.Z.vsix --repo ciatlas/flowpact # An SBOM was attested for that artifact, and the attached copy is the attested one: gh attestation verify flowpact-X.Y.Z.tgz --repo ciatlas/flowpact --predicate-type https://cyclonedx.org/bom \ --format json --jq '.[0].verificationResult.statement.predicate' | jq -S . > attested.cdx.json jq -S . flowpact-X.Y.Z.cdx.json | diff - attested.cdx.json # The npm package you installed is the one that was published with provenance: npm audit signatures # From 0.10.0: the release is immutable, and each file is the one GitHub attested for it: gh release verify vX.Y.Z --repo ciatlas/flowpact gh release verify-asset vX.Y.Z flowpact-X.Y.Z.tgz --repo ciatlas/flowpact ``` To check that the GitHub Action at a tag is the released one, compare the archive's files with the tag: ```sh mkdir action && tar -xzf flowpact-action-X.Y.Z.tar.gz -C action git clone --depth 1 --branch vX.Y.Z https://github.com/ciatlas/flowpact.git source diff -r action/packages/action/dist source/packages/action/dist && cmp action/action.yml source/action.yml ``` Pin the action to the commit you verified: `uses: ciatlas/flowpact@ # vX.Y.Z`. ## Repository practices [#repository-practices] - Changes reach `main` only through squash-merged pull requests that pass the required checks: **CI passed**, which includes flowpact's lint of its own workflows, and **Conventional PR title**. Nobody can push to `main` directly, force-push it or delete it, and no one is exempt from the checks (the `main` ruleset has no bypass). A pull request also needs a code owner's approval, except that the maintainer, the only repository admin, may merge any pull request without an approving review (GitHub does not let authors approve their own), and Renovate, which merges only its own pull requests (non-major updates, once the checks pass). The rules are kept in `.github/rulesets/`, and a weekly run reverts changes made in the settings UI. [MAINTAINERS.md](https://github.com/ciatlas/flowpact/blob/main/MAINTAINERS.md) lists who has access to what. - CodeQL (extended queries), [zizmor](https://docs.zizmor.sh) on the workflows and `action.yml` on every pull request, secret scanning with push protection, dependency updates (Renovate) and the [OpenSSF Scorecard](https://scorecard.dev/viewer/?uri=github.com/ciatlas/flowpact) run on the repository. - Vulnerabilities are reported privately, and only the latest release receives fixes; see the [security policy](https://github.com/ciatlas/flowpact/security/policy), which also lists the [security fixes in past releases](https://github.com/ciatlas/flowpact/blob/main/SECURITY.md#security-fixes-in-past-releases). - flowpact meets the [OpenSSF Best Practices](https://www.bestpractices.dev/projects/15403) criteria at the passing level and the [OpenSSF Baseline](https://www.bestpractices.dev/projects/15403/baseline-2) at level 2. At level 1 it meets every control but OSPS-QA-05.01 (no generated executables in version control): the GitHub Action's bundle is committed so that `uses:` can run it, and CI rebuilds it from source on every pull request and fails on any difference. `.bestpractices.json` in the repository records each answer and its evidence. # Stability (https://ciatlas.github.io/flowpact/docs/stability) Build on these. Only a major release changes one in an incompatible way, and says so under **Breaking changes** in its release notes, with [upgrade notes](https://ciatlas.github.io/flowpact/docs/upgrading); minor and patch releases never do. This holds before 1.0 too: the next breaking change releases 1.0.0. Up to 0.14, a breaking change could come in a minor release (0.8 → 0.9). | Interface | Reference | | --- | --- | | CLI commands, flags and exit codes | [CLI](https://ciatlas.github.io/flowpact/docs/cli) | | JSON report | [`/schemas/report/v1.json`](https://ciatlas.github.io/flowpact/schemas/report/v1.json); an incompatible change makes it v2, and `meta.schemas.report` says which a report follows | | SARIF | SARIF 2.1.0, with stable fingerprints in `partialFingerprints["flowpact/v1"]` | | Annotations | `--format github`: GitHub workflow commands | | Config and contracts | [`/schemas/config/v1.json`](https://ciatlas.github.io/flowpact/schemas/config/v1.json), [`/schemas/contract/v1.json`](https://ciatlas.github.io/flowpact/schemas/contract/v1.json) | | Rule codes and names | [Rules](https://ciatlas.github.io/flowpact/docs/rules); configs, overrides and `--only` refer to them | | Plugin rules | The rule object in [Custom rules](https://ciatlas.github.io/flowpact/docs/custom-rules) | | GitHub Action inputs and outputs | [GitHub Action](https://ciatlas.github.io/flowpact/docs/action) | | API: the functions, their options, results and errors (`import { lint } from 'flowpact'`) | [API](https://ciatlas.github.io/flowpact/docs/api) | Not stable: the terminal output and the wording of messages and Markdown reports, which are written for people (parse JSON or SARIF instead); the types of the data-flow graph a plugin rule reads through `ctx.index`; the `@flowpact/*` packages inside the repository; and `@ciatlas/core`, the workflow model they are built on. None of them is published (use the [API](https://ciatlas.github.io/flowpact/docs/api)). The [API](https://ciatlas.github.io/flowpact/docs/api) follows the same policy as the CLI. Its one exception is `RuleContext.index`, the data-flow graph a [plugin rule](https://ciatlas.github.io/flowpact/docs/custom-rules) reads, and the types it leads to. # Threat model (https://ciatlas.github.io/flowpact/docs/threat-model) This is the security assessment of flowpact 0.26.0 and the changes on `main` since (the two fixes this review led to: impact mode's own rules judged by the baseline, and suggested edits that write only plain names), built on `@ciatlas/core` 2.3.0, as of 2026-10-20, revisited on 2026-10-28 for the quick fix of FP507 and on 2026-10-29 for FP506's, on 2026-10-30 for the move of the remote fetcher into `@ciatlas/core` 2.6.0, and on 2026-11-02 for the move of the sources cache into `@ciatlas/core` 2.7.0. It names what flowpact protects and where untrusted data and code cross into it, then ranks the threats by likelihood times impact. For each threat it gives the code that defends against it, the tests that check that code, and the risk that remains. It is revisited for every new feature and every breaking change, and the version and date above change with each review. The [security page](https://ciatlas.github.io/flowpact/docs/security) describes what flowpact reads, writes and sends, and how to verify a release; to report a vulnerability, see the [security policy](https://github.com/ciatlas/flowpact/security/policy). Paths are in this repository, except those marked (core), which are in [ciatlas/core](https://github.com/ciatlas/core/tree/v2.7.0) at v2.7.0. ## Assets [#assets] - **The analyzed repository.** Its workflows, actions, config and contracts, and in impact mode the same files at the base commit. They are untrusted input: in CI, whoever opens a pull request controls their contents, their names and their symlinks, and flowpact's output repeats names and text from them. - **Plugins.** JavaScript modules named by the config, the action's `plugin` input or `--plugin`. Once loaded, a plugin is trusted code with every right of the process; flowpact does not sandbox it. - **The CI runner.** The job's secrets and environment, the workspace, the action's `token` input (`github.token` by default, used for the `git fetch` of impact mode and, with `remotes: fetch`, for GitHub API reads of remote repositories) and the runner's own token for the drift artifact. The runner reads flowpact's log for workflow commands, and reviewers read its annotations and job summary. - **The user's machine.** For the CLI, the language server and the VS Code extension: files outside the repository, the terminal that shows the output, the editor, and the GitHub token `flowpact remotes update` and `--fetch-remotes` read remote repositories with (`GH_TOKEN`, `GITHUB_TOKEN` or the GitHub CLI's). - **The release pipeline.** `release.yml`, running from `main`. The release bot's private key (`RELEASE_BOT_PRIVATE_KEY`, an organization secret that only ciatlas/flowpact and ciatlas/core can read). The publishing identities, each exchanged for a short-lived token at each publish: npm and Open VSX accept `release.yml` in the `npm` and `open-vsx` environments, and the Marketplace's Azure identity accepts any job in the `vscode-marketplace` environment (`release.yml` and `vscode-publisher.yml`); the three environments deploy only from `main`. The accounts behind them: the maintainer's GitHub account (an organization owner; the organization requires two-factor authentication), the npm account, the Marketplace publisher, the Open VSX namespace and the Azure subscription that holds the Marketplace identity. - **Dependencies.** The npm packages in `pnpm-lock.yaml`, bundled into the CLI, the action and the extension, and the build tools that run in CI; and `@ciatlas/core`, a git dependency on a release tag of ciatlas/core, which has the same maintainer. - **The released artifacts.** The npm package, the action at its tags (including the floating tag of each minor line, such as `v0.19`), the `.vsix` on the two registries, the signed files of each GitHub release, and this site, which `docs.yml` deploys to GitHub Pages from `main`. ## Trust boundaries [#trust-boundaries] 1. **Repository to flowpact.** Everything read from the analyzed repository is parsed as untrusted data, and read only from inside the repository. 2. **flowpact to its readers.** Output goes to the runner's log, GitHub's annotations and job summary, a terminal and an editor, and each of them reads some text as commands or markup. 3. **Config to code.** Loading a plugin turns repository content into code that runs. The only control is whether it loads. 4. **Workflow to command line.** A workflow may put untrusted text, such as a pull request title, into a flag value. 5. **Dependencies to the bundle.** Third-party code enters flowpact's artifacts when CI builds them. 6. **Release workflow to registries.** The publishing identities and the release bot's key turn a commit on `main` into what users install. 7. **Registries to users.** Users get flowpact from npm, the action's tags, the Marketplace or Open VSX, and can check it against the signed GitHub release. 8. **GitHub API to flowpact.** With `flowpact remotes update`, `--fetch-remotes` or the action's `remotes: fetch`, flowpact reads workflow and action files of other repositories, chosen by the `uses:` references of the analyzed repository, with a token. With `--github-com` (the action's `remotes-github-com`), the references a GitHub Enterprise Server lacks are looked up on github.com too, with `GITHUB_COM_TOKEN` or none. `remotes update` and `remotes download` keep the files they read in a per-user cache, which the editor opens. 9. **Suggestions to the repository's files.** Quick fixes, completion, rename, the override the editor adds and the regenerated contracts are edits built partly from text of the analyzed repository and the lockfile. The editor applies them when the user picks them; the JSON report and SARIF carry the same fixes (`suggestions`, `fixes`). ## Threats, ranked [#threats-ranked] Likelihood and impact are rated low, medium or high. The rank is likelihood times impact before mitigation, and ties are ordered by the residual risk. | Rank | Threat | Likelihood | Impact | Residual risk | | --- | --- | --- | --- | --- | | 1 | [Plugins run on untrusted code](#plugins-run-on-untrusted-code) | medium | high | medium | | 2 | [A compromised dependency](#a-compromised-dependency) | medium | high | medium | | 3 | [Injection through output](#injection-through-output) | high | medium | low | | 4 | [Writes through symlinks](#writes-through-symlinks) | medium | high | low | | 5 | [A pull request weakens its own impact check](#a-pull-request-weakens-its-own-impact-check) | medium | medium | low | | 6 | [A stolen release-bot key or publishing credential](#a-stolen-release-bot-key-or-publishing-credential) | low | high | medium | | 7 | [A compromised `@ciatlas/core` release](#a-compromised-ciatlascore-release) | low | high | low | | 8 | [A tampered release](#a-tampered-release) | low | high | low | | 9 | [Argument injection through flag values](#argument-injection-through-flag-values) | low | high | low | | 10 | [Edits built from untrusted names](#edits-built-from-untrusted-names) | low | high | low | | 11 | [Remote interfaces mislead the checks or the token](#remote-interfaces-mislead-the-checks-or-the-token) | low | medium | low | | 12 | [Resource exhaustion](#resource-exhaustion) | medium | low | low | ### Plugins run on untrusted code [#plugins-run-on-untrusted-code] A pull request adds a plugin to the config, or changes one the config lists. A CI job that runs flowpact on that checkout with plugins on runs the pull request's code with the job's token and secrets; on a developer's machine, it runs with the user's rights. - **Mitigation.** In the action, `plugins: auto` (the default) loads no plugin from the checkout on `pull_request_target` and `workflow_run` (`pluginsAllowed` and `UNTRUSTED_EVENTS` in `packages/action/src/main.ts`). A file of the `plugin` input that lies in the checkout is skipped there too, and the step warns that it skipped them. The extension declares limited support for untrusted workspaces, with `flowpact.plugins` restricted (`packages/vscode/package.json`), and turns plugins on in the language server only in a trusted workspace (`serverSettings` in `packages/vscode/src/settings.ts`). The language server loads none unless the client asks (`packages/language-server/src/settings.ts`), and then only for repositories inside the workspace folders (`packages/language-server/src/workspace.ts`). The CLI skips the config's plugins when `--no-plugins` appears anywhere in its arguments (`createContext` in `packages/cli/src/shared.ts`). A base config cannot list plugins (`REPOSITORY_ONLY` in `packages/lint/src/config.ts`). Plugins are local files that `loadPlugins` imports (`packages/lint/src/plugins.ts`); flowpact never downloads or installs one. - **Tests.** `packages/action/test/main.test.ts` (plugins on untrusted events, files of the `plugin` input in the checkout), `packages/vscode/test/settings.test.ts`, `packages/language-server/test/server.test.ts` (plugins only when the client trusts the workspace), `packages/cli/test/cli.e2e.test.ts` (`--no-plugins` and `--plugin`), `packages/lint/test/config.test.ts` (plugins in a base config). - **Residual risk: medium.** A loaded plugin can read the `token` input, the environment and the file system. `plugins: auto` goes by the event name only: a workflow that checks out a pull request's code on another event, such as `issue_comment`, while it holds secrets, runs that pull request's plugins. Set `plugins: false` there. The CLI loads the config's plugins by default, so a script that runs it on code it does not trust must pass `--no-plugins`. ### A compromised dependency [#a-compromised-dependency] A malicious version of a package that flowpact bundles, or of a tool that builds or publishes it, is published to npm. - **Mitigation.** Users install nothing but flowpact's own files: the npm package declares no dependencies (`scripts/check-pack.mjs` fails CI and the publish otherwise), the action runs its committed bundle, and the extension bundles the language server. A dependency reaches users only inside a flowpact release. Versions and integrity hashes are fixed in `pnpm-lock.yaml`, and every workflow installs with `--frozen-lockfile`. pnpm runs install scripts only for esbuild (`allowBuilds` in `pnpm-workspace.yaml`), and the jobs that publish the extension install with `--ignore-scripts`. Renovate proposes a version only two days after it was published (`minimumReleaseAge` in `renovate.json`, except for `@ciatlas/core` and updates that only pin the version in use) and raises OSV vulnerability alerts. Its pull requests must pass every required check; non-major updates then merge without review, but nothing ships until the maintainer merges the release pull request. The extension is built in a job with read access only (`vscode-package` in `release.yml`), and so is this site (the `build` job of `docs.yml`; only its `deploy` job, which runs no build tool, can write to GitHub Pages). Each artifact lists what it bundles in `THIRD_PARTY_LICENSES.txt` and a CycloneDX SBOM (`scripts/bundle-licenses.ts`). - **Tests.** `scripts/test/bundle-licenses.test.ts`; CI's **Action bundle is up to date** job, which rebuilds the action and fails when the result differs from the committed bundle; `scripts/check-pack.mjs`, in CI and before the npm publish. - **Residual risk: medium.** Third-party actions, pinned to a commit SHA, also update themselves after two days (non-major) and run with the release bot's key or a publishing identity as soon as they are on `main`. A malicious patch version that goes unnoticed for two days and passes the tests merges itself and ships with the next release; reviewing the release pull request is unlikely to catch it in the rebuilt bundle. Third-party packages also run in jobs that hold credentials: the release pull request job rebuilds the action bundle with the release bot's token (`contents: write`), the npm job builds the package with the npm publishing identity, and the Marketplace and Open VSX jobs of `release.yml`, and `vscode-publisher.yml`, run the lockfile-pinned vsce and ovsx with a publishing identity (`--ignore-scripts` stops only their install scripts). A compromised package there could push to branches other than `main`, move a floating tag, publish to npm with valid provenance, or publish the extension. ### Injection through output [#injection-through-output] Names, descriptions and source lines from the analyzed files appear in flowpact's output. A pull request can choose them to forge annotations or hide later log lines with workflow commands (`::…` at the start of a line, `##[…]` anywhere), to rewrite a terminal with escape sequences, or to add HTML, links, images or @mentions to the job summary. - **Mitigation.** `neutralizeWorkflowCommands` (core `src/text.ts`) puts a zero-width space into every line the runner would read as a command: `::` at its start (after whitespace, U+0085 or color codes) and `##[` anywhere. The CLI applies it to every string written to stdout and stderr (`packages/cli/src/index.ts`) and to every text report it writes (`writeOutput` in `packages/cli/src/shared.ts`); the API's text output and the action's log lines use it too. JSON and SARIF are written with `jsonSafe` (core), which encodes `##[` and the Unicode line separators. The only workflow commands flowpact prints on purpose, annotations, have every value escaped (`workflowCommands` in `packages/reporters/src/kit/github.ts`; the action uses `@actions/core`). For terminals, `escapeControl` (core) and `safe` (`packages/reporters/src/kit/theme.ts`) print C0 and C1 control characters, ESC included, as visible escapes, and colors and OSC 8 links appear only when asked for. For Markdown, `markdownText` (`packages/reporters/src/kit/markdown.ts`) escapes HTML, link brackets and backslashes, keeps code spans balanced and breaks @mentions; the job summary is cut to fit GitHub's 1 MiB limit (`summaryWithinLimit`). Hovers and completion in the editor show repository text escaped or as inline code (`packages/language-server/src/hover.ts`, `completion.ts`). - **Tests.** `test/text.test.ts` (core); `packages/cli/test/cli.e2e.test.ts` and `packages/cli/test/api.test.ts` (no line GitHub would run as a workflow command, control characters from the YAML); `packages/reporters/test/github.test.ts` (nothing can end an annotation early); `packages/reporters/test/markdown.test.ts` (Markdown escaping of untrusted names); `packages/reporters/test/reporters.test.ts` (colors and OSC 8 links only when asked); `packages/lint/test/review-round3.test.ts`; `packages/language-server/test/hover.test.ts` and `completion.test.ts`. - **Residual risk: low.** Unicode bidirectional controls and look-alike characters are printed as they are, so a name can read differently from what it is. GitHub still turns bare URLs in the job summary into links. Patches and contracts are written byte for byte, as git must apply them; a later step that prints them prints text from the pull request. No test runs the action's own log lines against hostile names; they go through the same function as the CLI's. ### Writes through symlinks [#writes-through-symlinks] A pull request commits a symlink where flowpact writes: a contract file, a report file, or a directory on the way to one. Followed, the link would let a write in CI land outside the repository, such as in the runner's home directory or another checkout, or in its `.git` directory. - **Mitigation.** For reports, patches, `--dump-graph` and `generate --out`, `assertSafeWritePath` (`packages/lint/src/contracts.ts`) refuses a path that leads into the repository (or, in GitHub Actions, the workspace; `protectedTrees` in `packages/cli/src/lib/targets.ts`) and then is a symlink itself, goes through a symlink that lies inside that tree, even a linked directory that stays in it, such as one into `.git` (`followsLinkIn`), or resolves outside it. It compares canonical real paths, so another spelling of a directory does not skip the check, and links outside the tree, such as `/tmp` for `/private/tmp`, are still followed. The CLI's reports, patches and graphs (`writeOutput`), `generate --out` (`writeContracts`) and the action's reports (`writeReport`) are all written through it. `writeContracts` checks every contract before it writes or deletes any, and refuses one that is a symlink, goes through one in the repository (`followsLinkIn`), or resolves outside the repository or into `.git` (`insideRepository` in core `src/project.ts`). Reads are kept inside the repository and out of `.git` too, the default config included (`loadConfig` in `packages/lint/src/config.ts`). The action writes the drift artifact to the runner's temporary directory, or, outside GitHub Actions, to a new private directory (`driftArtifact`). - **Tests.** `packages/lint/test/review-round3.test.ts` and `packages/lint/test/review-round2.test.ts` (writes and reads through symlinks, linked directories in the repository, `.git`, the config); `packages/cli/test/cli.e2e.test.ts` (reports, `--out` and contracts written in place, through a symlink or a linked directory in the repository, also one into `.git`, refused before anything is written); `packages/action/test/main.test.ts` (a report through a symlink or a linked directory in the checkout, also one into `.git`; the drift artifact's folder); `test/project.test.ts` (core; reads through symlinks out of the repository, into `.git` or up out of it). - **Residual risk: low.** The check runs before the write, and files are not opened with `O_NOFOLLOW`: a process that changes the directory in between, such as a step running in the background, can still redirect a write. Paths outside the repository and the workspace, such as `$GITHUB_STEP_SUMMARY`, are written as given. Versions before 0.12.3 followed some of these links; the [security policy](https://github.com/ciatlas/flowpact/blob/main/SECURITY.md#security-fixes-in-past-releases) lists which. ### A pull request weakens its own impact check [#a-pull-request-weakens-its-own-impact-check] Impact mode gates a pull request on how its changes to published workflows and actions affect callers. The pull request also controls the files that decide what is graded and whether a finding counts: the repository's config, with its `ignore`, the severities of rules and their overrides; a base config inside the repository, and the links and submodules on the way to it; the paths the workflow passes; and, since 0.25, ignore comments in the files it changes. Since 0.15, paths and `ignore` leave units out of grading, so a pull request could try to leave out the unit it breaks, or turn off, override or comment away the finding that fails it. - **Mitigation.** A published unit is left out only when both the baseline's `ignore` and the pull request's match it, so adding a unit to `ignore` still grades the pull request that adds it, with a note (`ignoreAddedOf` in `packages/lint/src/impact.ts`). A base config that is a file of the repository is read on the baseline side as the baseline commit has it: through links, through submodules at the commit each side records, and in the letter case the file system stores, also with `core.ignorecase=false` (`repositoryPathOf`, `locate`, `recordedAt`, `ignoresCase` and `ignoreAfterMerge` in `packages/lint/src/impact-run.ts`). A submodule commit the clone lacks leaves nothing out, and the run says so. Paths scope the verdict and the findings together, so a run never passes with a verdict that requires more than the pull request declares. `impact: auto` skips a run only when the recorded commit's config leaves out every published unit too (`nothingPublishedNote` in `packages/action/src/main.ts`). Impact mode's own rules (FP810 to FP814) take their severities and overrides from the baseline's config, like the policy, so the pull request's `rules:` cannot turn them off and an override it adds applies only once it is merged, with a note saying so; an ignore comment that names one accepts nothing and is reported ([`FP904`](https://ciatlas.github.io/flowpact/docs/rules/fp904)) (`baselineSettings`, `impactSeverities` and `honoredIn` in `packages/lint/src/analyze.ts`, `pendingSettings` in `packages/lint/src/impact-run.ts`). - **Tests.** `packages/lint/test/impact-run.test.ts` and `packages/lint/test/impact.test.ts` (links, chains, a link to the repository's top, submodules moved off or lacking their recorded commit, letter case); `packages/cli/test/cli.impact.e2e.test.ts` (each bypass found in review, end to end, including impact mode's rules turned off, overridden or named in an ignore comment by the pull request); `packages/action/test/main.test.ts` (`impact: auto`). Before release, a matrix of 3,024 runs over seven kinds of base config and every event gave no run that passes where the stricter reading fails. - **Residual risk: low.** A base config that a workflow step generates counts on both sides, so a pull request that edits that step controls it; on `pull_request` the workflow runs from the pull request's head, so the pull request controls the run anyway. Requiring the check, and reviewing changes to the workflow that runs it, is up to the repository. Outside impact mode, the pull request's own config and ignore comments decide what `lint` reports, as they decide the rest of what it changes: accepted findings are listed apart (`suppressed`, `ignoredByComment`, the job summary), and the override or comment shows in the diff. Before 0.26.1, a pull request could turn impact mode's rules off or accept their findings in its own config, and from 0.25.0 with an ignore comment. ### A stolen release-bot key or publishing credential [#a-stolen-release-bot-key-or-publishing-credential] Someone gets the release bot's private key, or the credentials of an account that can publish flowpact. - **Mitigation.** The key is an organization secret that only the workflows of ciatlas/flowpact and ciatlas/core can read. In this repository, three workflows use it: `release.yml` (the release pull request and the floating tag), `repo-settings.yml` (applying the rulesets and settings files from `main`, the only job that asks for administration) and the commit job of `dependency-bundle.yml`, which runs nothing from the branch it commits to. Each job asks only for the permissions it needs (the `permission-*` inputs of `actions/create-github-app-token`). `CONTRIBUTING.md` describes how to rotate the key. No publishing token is stored in GitHub: npm and Open VSX accept the release workflow (`release.yml`) in their environments, and the Marketplace's Azure identity accepts any job in the `vscode-marketplace` environment (`release.yml` and `vscode-publisher.yml`); each issues a short-lived token, and those environments deploy only from `main` (`.github/environments.json`). Every `flowpact` version from 0.2.1 on was published through npm trusted publishing, with provenance. Nobody can push to `main`, no one is exempt from its checks (the `main` ruleset has no bypass), the organization requires two-factor authentication, and secret scanning with push protection runs on the repository. - **Tests.** None in the test suite. `repo-settings.yml` shows how the live rulesets and settings differ from the files on every pull request that changes them, and applies them on every push to `main` that changes them, and every week. - **Residual risk: medium.** The app has administration and contents write access. With its key, someone can push to any branch but `main`, create or move `v*` tags other than those of immutable releases (0.10.0 and later), so the floating tags and the tags of releases up to 0.9.0 included, and change the rulesets that keep it off `main`; from `main`, a changed release workflow would publish everywhere with valid provenance. Workflows that pin the action to a commit SHA do not follow a moved tag. Accounts outside GitHub can publish without the pipeline: the npm account (the only owner of `flowpact` and of the deprecated `workflow-contracts`, which published their `0.0.0-stage` placeholders by hand; `flowpact` 0.2.0 and `workflow-contracts` 0.1.0 came from the release workflow with its token), the Marketplace publisher's members, the owner of the Open VSX namespace and the Azure subscription that holds the Marketplace identity. A version published that way has no build provenance and no signed GitHub release, which the checks under [Verify a release](https://ciatlas.github.io/flowpact/docs/security#verify-a-release) show. With one maintainer, the maintainer's GitHub account, an organization owner, is a single point of compromise for all of the above. ### A compromised `@ciatlas/core` release [#a-compromised-ciatlascore-release] Someone releases a malicious version of the workflow model, or moves one of its tags. - **Mitigation.** Every package depends on the same release tag, and `pnpm-lock.yaml` pins it to a commit, with a sha512 hash of its tarball; with `--frozen-lockfile`, a moved tag changes nothing until the lockfile does. `scripts/test/core-dependency.test.ts` fails unless every package names the same release tag, nothing links a local checkout, and the lockfile resolves it to a commit whose version is the tag's. ciatlas/core has the same branch and tag rulesets as this repository, and immutable releases. A new core arrives as a Renovate pull request that runs the whole suite, and ships only in a release that the maintainer merges. The SBOM names it `pkg:github/ciatlas/core@vX.Y.Z`. - **Tests.** `scripts/test/core-dependency.test.ts`; `scripts/test/bundle-licenses.test.ts` (a git dependency on a version tag is named by its repository and tag). - **Residual risk: low.** Core has the same maintainer, organization and release bot key, so the [stolen key](#a-stolen-release-bot-key-or-publishing-credential) threat applies to it too. Core updates skip Renovate's two-day wait, and a patch update merges itself once the checks pass. ### A tampered release [#a-tampered-release] Someone changes what users download: a file of a GitHub release, the action at a tag, the npm tarball or the `.vsix`. - **Mitigation.** Releases are built only by `release.yml`, from a tag that the workflow checks exists. A release stays a draft until every signed file is attached, and immutable releases, enabled in this repository (from 0.10.0) and in ciatlas/core, lock its tag and files once it is published. Each artifact has a Sigstore bundle, in-toto build provenance and an attested SBOM (`actions/attest`), and the npm package has npm provenance. The action's bundle is committed and rebuilt in CI, and CI builds its release archive twice and compares the bytes (`scripts/action-archive.sh`). The jobs that publish the extension check the `.vsix` against the release's file (SHA-256) before they upload it. The published npm package is smoke-tested on Linux, macOS and Windows. [Verify a release](https://ciatlas.github.io/flowpact/docs/security#verify-a-release) gives the commands to check each artifact. - **Tests.** CI's **Action bundle is up to date** job (the bundle and the archive are reproducible); the release workflow's smoke tests of the published package. - **Residual risk: low.** Releases up to 0.9.0 are not immutable: an admin or the release bot can still move their tags. Verification is up to the user. The floating tag of a minor line, such as `v0.12`, belongs to no release and moves with each one, so a workflow that uses it trusts whoever can move it; pin a commit SHA instead. The Marketplace and Open VSX serve their own copy of the `.vsix`, which can be compared with the signed release file only by hand. Releases up to 0.11.1 verify under the old owner. The two `0.0.0-stage` placeholders, the first versions of `flowpact` and `workflow-contracts` on npm, contain no code, have no provenance and are deprecated, like the rest of `workflow-contracts`. ### Argument injection through flag values [#argument-injection-through-flag-values] A workflow passes untrusted text as a flag value, such as `--title "$PR_TITLE"`. Read as arguments, a title such as `--plugin=x.js`, `--` or `--help` could load a plugin, redirect a report, turn off `--no-plugins` or end the run. - **Mitigation.** Before citty reads the arguments, `normalizeArgv` (`packages/cli/src/shared.ts`) attaches every value of a string flag to its flag (`--title X` becomes `--title=X`), and `repeatedFlag` reads repeated flags with `node:util`'s `parseArgs`, so a value is never taken for another flag. Options before the command are a usage error. Git runs without a shell; refs that start with `-` are refused, and other refs are passed after `--end-of-options` (`resolveCommit` in core `src/git.ts`). The action reads its inputs from `with:`, not from a command line. - **Tests.** `packages/cli/test/args.test.ts`; `packages/cli/test/cli.e2e.test.ts` (a pull request title as `--plugin` or `-o`, as `--`, as `--help`); `test/git.test.ts` (core; refs such as `--output=/tmp/x` are refused before git runs). - **Residual risk: low.** Only flag values are protected. A positional argument, such as a path, that starts with `-` is still read as an option; put untrusted paths after `--` (`flowpact lint -- "$PATHS"`). Quoting is the workflow's job: pass untrusted text through `env:`, not by expression interpolation in `run:`. ### Edits built from untrusted names [#edits-built-from-untrusted-names] A fix flowpact suggests, or a completion the editor offers, writes names it read from the analyzed files or the remote interfaces lockfile: an input to add, a name to rename to, a permission to grant. A pull request controls both, and a remote repository the names its lockfile entry records. Written as they are, a name with a line break or a `: ` adds other keys to the file the fix edits: a lockfile input named `x\n secrets: inherit\n y` would hand every secret to a remote workflow once the fix is applied. An edit that writes or deletes contract files could follow a symbolic link out of the repository. - **Mitigation.** A suggestion writes a name only when it needs no quoting, and no edit over several lines (`PLAIN_NAME` and `hasLineBreak` in `packages/lint/src/suggestions.ts`); otherwise the finding has no fix, and its message names the key escaped. A rule attaches a fix only when the change is certain, and FP613's writes only scope names of `[a-z-]` and the levels it knows (`raiseGrant` in `packages/lint/src/rules/permissions.ts`). FP507's fix only deletes text of a condition or writes `!`, never text from the files, and only where the expression is written on one line as it reads, in a file with LF line endings (`segmentEdits` in `packages/lint/src/expr-ast.ts`); it is left out when a plain YAML scalar would then start with `!`, which YAML reads as a tag, and FP507 does not report a condition whose text a YAML alias shares with another key, which may be a value. FP506's fix only writes ` != ''` after a reference, under the same conditions and never in a single-quoted scalar, which would read the `''` as one quote (`compareFix` in `packages/lint/src/rules/values.ts`). Completion offers no other name (`completionItems` in `packages/language-server/src/completion.ts`, with `isPlainName`). A rename writes the name the user types, and only a valid one (`packages/language-server/src/rename.ts`). The override the editor adds is written as quoted YAML strings (`packages/lint/src/override-entry.ts`), an ignore comment holds only the rule's code, and "Regenerate the contracts" is not offered when a contract path is a symlink, goes through one, or leads outside the repository (`unsafeContractPaths` in `packages/lint/src/contracts.ts`, the check `flowpact generate` makes). The language server writes no file itself: it returns workspace edits, which the editor applies when the user picks one (`packages/language-server/src/actions.ts`). - **Tests.** `packages/lint/test/suggestions.test.ts` (applying each fix removes its finding and adds no error; no fix that would write a name from the lockfile or a quoted key that is not plain); `packages/lint/test/rules/expressions.test.ts` (FP507's fixes decide each condition as before, for every value class under GitHub's own evaluator; none in single-quoted, multi-line or CRLF text, or where YAML would read a tag); `packages/lint/test/rules/values.test.ts` (FP506's fix only after references, none in single-quoted or CRLF text); `packages/language-server/test/completion.test.ts` (names that are not plain left out, descriptions shown as text); `packages/language-server/test/server.test.ts` (quick fixes, an override added with the reason the user gives, rename, regenerated contracts); `packages/lint/test/review-round3.test.ts` (contracts not written through symlinks). - **Residual risk: low.** A fix is applied as flowpact wrote it, and reviewing the change is up to whoever applies it; a tool that applies SARIF `fixes` by itself applies them unreviewed. No test runs the editor's "Regenerate" against a symlinked contract; it makes the same check as `generate`. From 0.22.0 to 0.26.0, suggestions wrote names as they were, and from 0.24.0 so did completion. ### Remote interfaces mislead the checks or the token [#remote-interfaces-mislead-the-checks-or-the-token] flowpact checks calls to other repositories against interfaces it does not hold itself: the [remote interfaces lockfile](https://ciatlas.github.io/flowpact/docs/remote-interfaces), which a pull request can edit, and the files it fetches, which those repositories serve. A pull request can try to make the checks pass with a false interface (an input marked optional, or a job that requests fewer permissions than it does), a remote repository can serve a file built to waste memory, a pull request that controls the references can try to make a privileged token read repositories it should not, and show what it read in findings, a reference built with `..` can try to make the [sources cache](https://ciatlas.github.io/flowpact/docs/remote-interfaces#sources-for-the-editor) write outside its directory, and a lockfile can name a host, or a commit other than the one a reference pins, to make the editor link or open other code than what runs. A pull request that moves a reference to another version can update the lockfile to an interface that keeps what the new version dropped, so that a breaking bump passes a check that gates automerge. GitHub's `actions.lock`, which a pull request can edit too, chooses the commit an action is read at. The opt-in look on github.com sends reference names to a second host. - **Mitigation.** The lockfile is validated against its schema before anything uses it, or reported by [`FP611`](https://ciatlas.github.io/flowpact/docs/rules/fp611) and not used (`readRemotesLock` in `packages/lint/src/remotes.ts`); each entry pins a commit SHA, and `flowpact remotes update` rewrites it from the source, so a false entry shows in the pull request's diff. An entry that records another commit than the full SHA its reference pins is not used at all, and [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) reports it (`pinMismatch` in `packages/lint/src/remotes.ts`): a false entry cannot make the calls of a pinned reference pass. Fetched files are parsed, never run, and refused over 1 MB or after 30 seconds (`fetchRemoteSourceAt` in `src/remote-fetch.ts` (core)), eight at a time (`packages/lint/src/remotes-fetch.ts`); a reference with a `.` or `..` name is refused before any request, so that it cannot send the token to another endpoint of the API (`checkNames` (core)). A remote unit has no body: nothing that follows a call into a callee reaches it (core `ProjectIndex.interfaceOf`, `actionInterfaceOf`). Fetching is opt-in; the token goes only to the GitHub API (`GITHUB_API_URL`) as an authorization header and is never printed, nor kept in a message (`headersOf`, `redact` (core)); the action does not fetch on `pull_request_target` or `workflow_run`, where an untrusted pull request would choose the references while the token may be privileged (`remotesToFetch` in `packages/action/src/main.ts`). The version changes of a pull request are graded against interfaces fetched for the run, never its own lockfile's, from the base commit's entries (`gradeVersionChanges` in `packages/lint/src/remotes-changes.ts`). `actions.lock` is parsed, never run or written, and a version or form flowpact does not know is not used (`readActionsLock` in `packages/lint/src/actions-lock.ts`) and is reported by [`FP614`](https://ciatlas.github.io/flowpact/docs/rules/fp614), so an edit cannot turn it off unseen; a commit it pins is the one the runner runs, after GitHub checks that it belongs to the repository, so reading the interface there checks what runs. It is never used for a reusable workflow call, which GitHub does not lock (`lockedCommit`). Only `flowpact remotes update` and `remotes download` keep the files they read, in a per-user cache: every part of the path (host, owner, repository, commit, each directory and the file name) must be a plain file name on every platform, or the file is not kept, and it is written to a temporary file, made read-only for your user alone, and renamed (`remoteCachePath` and `directoryRemoteCache` in `src/node-remote-cache.ts` (core)). A file is found only under exactly its name, through no link, so a case-insensitive file system never opens another file of the same commit. The action, `--fetch-remotes` and `--dry-run` write nothing there, and `remotes update` nothing in CI unless asked. Cleaning (`remotes clean`, and the pruning after `update` and `download`) removes only directories named by a commit at `///`, never following a link (`pruneRemoteCache`, ibid.). References and reasons from the lockfile are printed with control characters escaped (`packages/cli/src/lib/text.ts`). The github.com fallback is off unless asked, is used only for references the enterprise server answers as missing or unreadable, and never with the enterprise token (`withFallback` in `src/remote-fetch.ts` (core), `apiFor` in `packages/lint/src/remotes-fetch.ts`); an entry read there records `host: github.com`, which `remotes download` follows only with `--github-com`, and it skips any other host a lockfile names. The editor opens and links the commit a reference runs (its own full SHA, else the locked commit), and links a source only on a host it is sure of: github.com for an entry read there, `GITHUB_API_URL`, or a github.com or GHE.com `origin` (`webHostOf`, `sourceLink` in `packages/language-server/src/sources.ts`); it never analyzes a cached file. - **Tests.** `packages/lint/test/remotes.test.ts` (FP611 for an invalid lockfile, then nothing checked; `FP612` for an outdated one); `packages/lint/test/remotes-fetch.test.ts` (the enterprise token never sent to github.com); `test/remote-fetch.test.ts` (core; the token sent only to the API and never in a message, a response over 1 MB refused, a `.` or `..` name refused before any request); `test/node-remote-cache.test.ts` (core; paths that leave the cache, or are no file name on Windows, refused; files for your user alone; a file found only in its own case; links never followed when pruning); `packages/cli/test/cli.remotes.e2e.test.ts` (the token never in the output, control characters from the lockfile shown rather than sent, nothing cached by a dry run, `lint --fetch-remotes` or in CI unless asked); `packages/action/test/main.test.ts` (no fetch by default or on `pull_request_target`; a version change that breaks a call fails the step although the pull request's lockfile hides it); `packages/lint/test/remotes-changes.test.ts` (the head's interface fetched whatever the pull request's lockfile says); `packages/lint/test/actions-lock.test.ts` (an unknown version not used, and reported by FP614; a reusable workflow call read where its ref points, never at a pinned commit); `test/external.test.ts` (core; external units out of everything that follows a call); `packages/language-server/test/hover-remotes.test.ts` (no link to a host a lockfile names, the pinned commit opened rather than the one a lockfile claims); `packages/language-server/test/server.test.ts` (a cached file and a workspace folder in the cache not analyzed). - **Residual risk: low.** A false entry in the lockfile weakens only the checks of the repository that commits it, and only until a review or `flowpact remotes update` catches it. Where a job's environment sets `GITHUB_API_URL`, that is where the token goes; whoever writes the job already holds its token. On other events, `remotes: fetch` reads with whatever token the workflow gives it, so a workflow that runs untrusted code with a broad token should not opt in. With `--github-com`, the names of the references the enterprise server does not answer for go to github.com, including those of private repositories the enterprise token cannot read; leave it off where those names are sensitive. The cache holds the files of private repositories the token could read, protected by file permissions only. ### Resource exhaustion [#resource-exhaustion] A file built so that analyzing it takes disproportionate memory or time: YAML aliases that multiply, a matrix with a huge product, symlink loops or linked directories that fan out, or text that makes a regular expression backtrack. - **Mitigation.** Before resolving aliases, core counts the nodes they would produce; past 50,000 the file is not analyzed and gets `FP504` (`aliasExpansionTooLarge` in core `src/parse.ts`). Matrix products above 20,000 combinations are not enumerated (`MAX_COMBINATIONS` in core `src/matrix.ts`), and more than 256 jobs is reported (`FP406`). Directory walks follow at most 40 links in a path and expand at most 1,000 linked directories, keeping the shallowest (`MAX_LINKS` and `MAX_LINKED_DIRS` in core `src/project.ts` and `src/git.ts`). Output read from git is capped at 256 MiB. CodeQL's extended queries check the regular expressions, and code they flagged for backtracking (`js/polynomial-redos`) was rewritten to run in linear time, such as `trimChar` in core `src/text.ts`. The job summary stays under 1 MiB. - **Tests.** `packages/lint/test/review-round2.test.ts` (an alias bomb stops with `FP504` within 2 seconds; matrices up to 256 jobs pass, and a product of 22,500 jobs is reported as at least that many); `packages/lint/test/review-round3.test.ts` (an alias bomb in the config); `packages/lint/test/code-scanning.test.ts` (linear time on adversarial input); `packages/lint/test/robustness.test.ts` (a property test: arbitrary workflow-shaped input never throws); `test/matrix.test.ts`, `test/project.test.ts` and `test/git.test.ts` (core; large products, a directory linked into itself, fan-out, link depth); `packages/action/test/main.test.ts` (the job summary limit). - **Residual risk: low.** The size and number of files are not capped: time and memory grow with them, and in CI the job's timeout is the limit. # FP101 · missing-required-input (https://ciatlas.github.io/flowpact/docs/rules/fp101) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP101` | `missing-required-input` | Inputs | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`composite-actions`](https://github.com/ciatlas/flowpact/tree/main/fixtures/composite-actions) fixture: ```text ✖ ERROR FP101 missing-required-input Step tools uses .github/actions/install-tools without required input "versions-file" — GitHub will run it with an empty value ▶ .github/workflows/build.yml:11:15 ``` ## Why it matters [#why-it-matters] For reusable workflows GitHub fails the run when a required input is missing — even if the input also has a `default`, which is then never used. For composite actions `required` is not enforced at all: the step silently runs with an empty string (or the default), which is how test variants get skipped unnoticed. ## How to fix [#how-to-fix] Pass the input under `with:`, or mark it `required: false` with a `default` if it is truly optional. ## Example [#example] ```yaml jobs: test: uses: ./.github/workflows/test.yml with: suite: unit # "config" is required by test.yml but not passed ``` ```yaml jobs: test: uses: ./.github/workflows/test.yml with: suite: unit config: release ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP101] why`): ```yaml title=".github/workflows/build.yml" # flowpact: ignore[FP101] why it is acceptable here uses: ./.github/actions/install-tools ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP101 target: ".github/actions/install-tools#inputs.versions-file" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP101") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP101: off # or: missing-required-input: error ``` Explain it in the terminal: ```sh flowpact explain FP101 ``` ## Related [#related] - [`FP102`](https://ciatlas.github.io/flowpact/docs/rules/fp102) unknown-input: A caller passes an input the reusable workflow or local action does not declare. - [`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103) input-type-mismatch: A literal value passed to a typed `workflow_call` input has the wrong type. - [`FP107`](https://ciatlas.github.io/flowpact/docs/rules/fp107) optional-forwarded-to-required: A required input of a callee is fed from an optional input that is '' when omitted (no default, or `default: ''`). - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP102 · unknown-input (https://ciatlas.github.io/flowpact/docs/rules/fp102) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP102` | `unknown-input` | Inputs | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`composite-actions`](https://github.com/ciatlas/flowpact/tree/main/fixtures/composite-actions) fixture: ```text ✖ ERROR FP102 unknown-input .github/actions/install-tools has no input "version-file" — did you mean "versions-file"? ▶ .github/workflows/build.yml:13:11 ``` ## Why it matters [#why-it-matters] GitHub rejects undeclared inputs to reusable workflows, and ignores them (with a warning in the log) for actions. Usually it is a typo or a leftover after an input was renamed, so the value you meant to pass never arrives. ## How to fix [#how-to-fix] Rename the key to the declared input, declare the input in the callee, or remove the stale binding. ## Example [#example] ```yaml with: confg: release # test.yml declares "config" ``` ```yaml with: config: release ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP102] why`): ```yaml title=".github/workflows/build.yml" # flowpact: ignore[FP102] why it is acceptable here version-file: .tool-versions ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP102 target: ".github/actions/install-tools#inputs.version-file" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP102") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP102: off # or: unknown-input: error ``` Explain it in the terminal: ```sh flowpact explain FP102 ``` ## Related [#related] - [`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101) missing-required-input: A reusable workflow or local action is called without one of its required inputs. - [`FP108`](https://ciatlas.github.io/flowpact/docs/rules/fp108) undefined-input-ref: An expression reads `inputs.` that the workflow or action does not declare. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP103 · input-type-mismatch (https://ciatlas.github.io/flowpact/docs/rules/fp103) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP103` | `input-type-mismatch` | Inputs | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Reusable workflow inputs are typed (`string`, `boolean`, `number`). Passing `"true"` (a string) to a boolean input fails the run when the call is evaluated, typically on a code path you did not test locally. ## How to fix [#how-to-fix] Pass a value of the declared type (unquoted `true`/`false` for booleans, an unquoted number for numbers). ## Example [#example] ```yaml with: dry-run: "true" # declared type: boolean ``` ```yaml with: dry-run: true ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP103] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP103] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP103 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP103") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP103: off # or: input-type-mismatch: error ``` Explain it in the terminal: ```sh flowpact explain FP103 ``` ## Related [#related] - [`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101) missing-required-input: A reusable workflow or local action is called without one of its required inputs. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP104 · unused-input (https://ciatlas.github.io/flowpact/docs/rules/fp104) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP104` | `unused-input` | Inputs | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`composite-actions`](https://github.com/ciatlas/flowpact/tree/main/fixtures/composite-actions) fixture: ```text ▲ WARN FP104 unused-input Input "token" of .github/actions/install-tools is never read ▶ .github/actions/install-tools/action.yml:10:3 ``` ## Why it matters [#why-it-matters] Dead inputs accumulate in large interfaces: callers keep computing and passing values that go nowhere, and readers assume a knob works when it does not. ## How to fix [#how-to-fix] Remove the input (and the callers’ bindings), or wire it to where it was meant to be used. ## Example [#example] ```yaml on: workflow_call: inputs: legacy-flag: { type: boolean } # never referenced ``` ```yaml # remove it, or use it: if: inputs.legacy-flag ``` ## Scope [#scope] Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP104] why`): ```yaml title=".github/actions/install-tools/action.yml" # flowpact: ignore[FP104] why it is acceptable here token: ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP104 target: ".github/actions/install-tools#inputs.token" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP104") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP104: off # or: unused-input: error ``` Explain it in the terminal: ```sh flowpact explain FP104 ``` ## Related [#related] - [`FP106`](https://ciatlas.github.io/flowpact/docs/rules/fp106) passthrough-dropped: A caller passes a value to an input that the callee declares but never reads. - [`FP108`](https://ciatlas.github.io/flowpact/docs/rules/fp108) undefined-input-ref: An expression reads `inputs.` that the workflow or action does not declare. # FP105 · optional-input-no-default-in-condition (https://ciatlas.github.io/flowpact/docs/rules/fp105) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP105` | `optional-input-no-default-in-condition` | Inputs | 🟡 warning | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] When a caller omits an optional input that has no default, GitHub passes an empty string. A condition such as `if: inputs.deploy` then takes the "false" branch: the job or step is skipped and the run is still green, so nothing tells the caller that the value they left out turned it off. ## How to fix [#how-to-fix] If it must run, make the input `required: true` or give it a non-empty `default`. If skipping is intended, say so where it is decided: `inputs.x != ''` (the same at run time, but explicit), or read the skipped step's outputs through a fallback (`steps.token.outputs.token || github.token`). `default: ''` is not a fix: it is what GitHub passes for an omitted input. ## Example [#example] ```yaml inputs: environment: { type: string, required: false } ... - if: inputs.environment run: ./deploy.sh "${{ inputs.environment }}" ``` ```yaml inputs: environment: { type: string, required: false } app-id: { type: string, required: false } ... # Skipping without an environment is intended: say so - if: inputs.environment != '' run: ./deploy.sh "${{ inputs.environment }}" # Or let the consumers handle the skipped step - id: app-token if: inputs.app-id uses: actions/create-github-app-token@v2 - uses: actions/checkout@v5 with: token: ${{ steps.app-token.outputs.token || github.token }} ``` ## Scope [#scope] Not reported: comparisons with a constant, `contains()`-style tests, fallbacks inside a comparison or function argument (`startsWith(inputs.x || 'main', 'v')`), conditions that are true when the input is '' (`inputs.x || 'yes'`, `!inputs.x`), conditions with text around `${{ }}` (always true; actionlint reports them), and a step whose results are only read through a fallback that is not empty when the step is skipped (`steps.t.outputs.token || github.token`, not `|| ''` or the omitted input), in a condition that asks whether it ran (`if: steps.t.outcome == 'success'`) or that is true when it was skipped, as a whole (`!steps.t.outputs.token`, `always() || …`) or in the term that reads it (the operand of the nearest `&&` or `||` around the read, a comparison or function call around it included: `steps.t.outputs.x == ''` in `steps.t.outputs.x == '' && …`; false instead under an odd number of `!`: `steps.t.outputs.x == 'true'` in `!(steps.t.outputs.x == 'true' || …)`), or through a job output that is then '' and read one of those ways: the workflow then expects the step to be skipped. A step without an `id`, a job's `if:`, a condition that is false when the step was skipped (`!(steps.t.outputs.x == '')`), or a step whose outputs are also read as they are or gate another step (`if: steps.t.outputs.changed == 'true'`, also with `|| inputs.force`: skipped silently too) is still reported. Nor are inputs every local caller passes reported, unless the workflow can be dispatched or the unit is published (by default the root `action.yml` and reusable workflows whose file name does not start with `_`; see `impact.publish`), since callers in other repositories can still omit them. A `default` that is '' (`default: ''`, `default: ${{ '' }}`) counts as none. To accept the rule for one input in every workflow, use an override with `target: '**#inputs.'`. Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP105] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP105] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP105 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP105") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP105: off # or: optional-input-no-default-in-condition: error ``` Explain it in the terminal: ```sh flowpact explain FP105 ``` ## Related [#related] - [`FP107`](https://ciatlas.github.io/flowpact/docs/rules/fp107) optional-forwarded-to-required: A required input of a callee is fed from an optional input that is '' when omitted (no default, or `default: ''`). - [`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401) empty-binding-for-matrix-combo: An input passed under `with:` is empty for some matrix combinations because a matrix key is missing there. # FP106 · passthrough-dropped (https://ciatlas.github.io/flowpact/docs/rules/fp106) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP106` | `passthrough-dropped` | Inputs | 🔵 info | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ● INFO FP106 passthrough-dropped jobs.build passes "verbose" to .github/workflows/build.yml, which never reads it ▶ .github/workflows/pipeline.yml:25:7 ``` ## Why it matters [#why-it-matters] In deep call chains values are often forwarded level by level. When one level stops using an input, every caller above it keeps passing data that is silently dropped. ## How to fix [#how-to-fix] Stop passing the value here, or make the callee actually use (or forward) it. ## Example [#example] ```yaml jobs: build: uses: ./.github/workflows/build.yml with: target: linux verbose: true # build.yml declares "verbose" but never reads it ``` ```yaml jobs: build: uses: ./.github/workflows/build.yml with: target: linux ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP106] why`): ```yaml title=".github/workflows/pipeline.yml" # flowpact: ignore[FP106] why it is acceptable here verbose: true ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP106 target: ".github/workflows/build.yml#inputs.verbose" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP106") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP106: off # or: passthrough-dropped: error ``` Explain it in the terminal: ```sh flowpact explain FP106 ``` ## Related [#related] - [`FP104`](https://ciatlas.github.io/flowpact/docs/rules/fp104) unused-input: An input is declared but never read anywhere in the workflow or action. # FP107 · optional-forwarded-to-required (https://ciatlas.github.io/flowpact/docs/rules/fp107) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP107` | `optional-forwarded-to-required` | Inputs | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ▲ WARN FP107 optional-forwarded-to-required Required input "notes" of .github/workflows/build.yml is empty when optional input "release-notes" is omitted ▶ .github/workflows/pipeline.yml:24:18 ``` ## Why it matters [#why-it-matters] The call looks complete, so GitHub never complains about the required input, but when the outer caller omits the optional value the callee receives an empty string. The "required" guarantee is lost one level up. ## How to fix [#how-to-fix] Make the outer input required too, give it a non-empty default, or add a non-empty fallback: `${{ inputs.x || 'value' }}`. If the callee handles an empty value, make its input `required: false`. If the call is pointless without the value, skip it with `if: inputs.x != ''`. ## Example [#example] ```yaml # pipeline.yml inputs: config: { type: string, required: false } jobs: test: uses: ./.github/workflows/test.yml with: config: ${{ inputs.config }} # test.yml: config is required ``` ```yaml inputs: config: { type: string, required: true } ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP107] why`): ```yaml title=".github/workflows/pipeline.yml" # flowpact: ignore[FP107] why it is acceptable here notes: ${{ inputs.release-notes }} ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP107 target: ".github/workflows/build.yml#inputs.notes" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP107") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP107: off # or: optional-forwarded-to-required: error ``` Explain it in the terminal: ```sh flowpact explain FP107 ``` ## Related [#related] - [`FP105`](https://ciatlas.github.io/flowpact/docs/rules/fp105) optional-input-no-default-in-condition: An optional input that is '' when omitted (no default, or `default: ''`) decides an `if:` by its truthiness. - [`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101) missing-required-input: A reusable workflow or local action is called without one of its required inputs. # FP108 · undefined-input-ref (https://ciatlas.github.io/flowpact/docs/rules/fp108) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP108` | `undefined-input-ref` | Inputs | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Undeclared inputs always evaluate to an empty value. This is usually a typo or a rename that missed a usage. ## How to fix [#how-to-fix] Fix the name, or declare the input under `on.workflow_call.inputs` / `on.workflow_dispatch.inputs` / `inputs:`. ## Example [#example] ```yaml run: ./build.sh ${{ inputs.tagret }} ``` ```yaml run: ./build.sh ${{ inputs.target }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP108] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP108] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP108 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP108") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP108: off # or: undefined-input-ref: error ``` Explain it in the terminal: ```sh flowpact explain FP108 ``` ## Related [#related] - [`FP102`](https://ciatlas.github.io/flowpact/docs/rules/fp102) unknown-input: A caller passes an input the reusable workflow or local action does not declare. - [`FP104`](https://ciatlas.github.io/flowpact/docs/rules/fp104) unused-input: An input is declared but never read anywhere in the workflow or action. # FP201 · missing-required-secret (https://ciatlas.github.io/flowpact/docs/rules/fp201) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP201` | `missing-required-secret` | Secrets | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ✖ ERROR FP201 missing-required-secret jobs.package calls .github/workflows/package.yml without required secret "signing-key" ▶ .github/workflows/build.yml:29:11 ``` ## Why it matters [#why-it-matters] GitHub fails the run when a required secret is not passed — but only when that call path actually executes. ## How to fix [#how-to-fix] Pass the secret under `secrets:`, or use `secrets: inherit` if the callee should see all repository secrets. ## Example [#example] ```yaml uses: ./.github/workflows/deploy.yml secrets: token: ${{ secrets.TOKEN }} # deploy.yml also requires "registry-password" ``` ```yaml secrets: token: ${{ secrets.TOKEN }} registry-password: ${{ secrets.REGISTRY_PASSWORD }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP201] why`): ```yaml title=".github/workflows/build.yml" # flowpact: ignore[FP201] why it is acceptable here uses: ./.github/workflows/package.yml ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP201 target: ".github/workflows/package.yml#secrets.signing-key" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP201") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP201: off # or: missing-required-secret: error ``` Explain it in the terminal: ```sh flowpact explain FP201 ``` ## Related [#related] - [`FP202`](https://ciatlas.github.io/flowpact/docs/rules/fp202) unknown-secret: A caller passes a secret the reusable workflow does not declare. - [`FP205`](https://ciatlas.github.io/flowpact/docs/rules/fp205) undeclared-secret-ref: A reusable workflow reads a secret it does not declare, and some caller does not use `secrets: inherit`. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP202 · unknown-secret (https://ciatlas.github.io/flowpact/docs/rules/fp202) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP202` | `unknown-secret` | Secrets | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] GitHub rejects the call ("Invalid secret … is not defined in the referenced workflow"). ## How to fix [#how-to-fix] Declare the secret under `on.workflow_call.secrets` in the callee, fix the name, or remove it. ## Example [#example] ```yaml jobs: deploy: uses: ./.github/workflows/deploy.yml # declares the secret deploy-token secrets: deploy_token: ${{ secrets.DEPLOY_TOKEN }} ``` ```yaml secrets: deploy-token: ${{ secrets.DEPLOY_TOKEN }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP202] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP202] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP202 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP202") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP202: off # or: unknown-secret: error ``` Explain it in the terminal: ```sh flowpact explain FP202 ``` ## Related [#related] - [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201) missing-required-secret: A reusable workflow is called without one of its required secrets. - [`FP205`](https://ciatlas.github.io/flowpact/docs/rules/fp205) undeclared-secret-ref: A reusable workflow reads a secret it does not declare, and some caller does not use `secrets: inherit`. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP203 · unused-secret (https://ciatlas.github.io/flowpact/docs/rules/fp203) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP203` | `unused-secret` | Secrets | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ▲ WARN FP203 unused-secret Secret "signing-key" of .github/workflows/package.yml is never read ▶ .github/workflows/package.yml:17:7 ``` ## Why it matters [#why-it-matters] Every caller must still wire the secret, widening its exposure for nothing. ## How to fix [#how-to-fix] Remove the declaration and the callers’ `secrets:` bindings, or use the secret where intended. ## Example [#example] ```yaml on: workflow_call: secrets: npm_token: required: true # nothing below reads it jobs: test: runs-on: ubuntu-latest steps: - run: npm test ``` ```yaml jobs: publish: runs-on: ubuntu-latest steps: - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.npm_token }} ``` ## Scope [#scope] A secret counts as read when the workflow reads it by name or reads the whole `secrets` context (`toJSON(secrets)`, `secrets.*`, `secrets[inputs.name]`), or hands every secret through `secrets: inherit` to a callee that reads it by name or reads every secret it gets, itself or further down. An expression that does not parse, and a callee flowpact cannot read (a remote workflow, or a local one that is missing or not reusable), may read any secret, so they count as reading every secret. Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP203] why`): ```yaml title=".github/workflows/package.yml" # flowpact: ignore[FP203] why it is acceptable here signing-key: ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP203 target: ".github/workflows/package.yml#secrets.signing-key" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP203") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP203: off # or: unused-secret: error ``` Explain it in the terminal: ```sh flowpact explain FP203 ``` ## Related [#related] - [`FP204`](https://ciatlas.github.io/flowpact/docs/rules/fp204) secrets-inherit: `secrets: inherit` hands every repository secret to the callee; flowpact lists what is actually needed. # FP204 · secrets-inherit (https://ciatlas.github.io/flowpact/docs/rules/fp204) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP204` | `secrets-inherit` | Secrets | 🔵 info | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ● INFO FP204 secrets-inherit jobs.build inherits all secrets; .github/workflows/build.yml and its callees read REGISTRY_TOKEN ▶ .github/workflows/pipeline.yml:26:5 ``` ## Why it matters [#why-it-matters] Inherit makes the secret flow invisible: nobody can tell from the caller which secrets reach which job, and every nested workflow gets all of them. ## How to fix [#how-to-fix] Replace `secrets: inherit` with an explicit `secrets:` mapping of the secrets listed in the message. ## Example [#example] ```yaml uses: ./.github/workflows/deploy.yml secrets: inherit ``` ```yaml uses: ./.github/workflows/deploy.yml secrets: DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} ``` ## Scope [#scope] Not reported when the callee, or a callee it hands every secret to, reads the whole `secrets` context (`toJSON(secrets)`, `secrets.*`, `secrets[inputs.name]`), has an expression that does not parse, or hands every secret on to a workflow flowpact cannot read (a remote workflow, or a local one that is missing or not reusable): it then reads, or may read, every secret the caller has, which no explicit mapping can list. Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP204] why`): ```yaml title=".github/workflows/pipeline.yml" # flowpact: ignore[FP204] why it is acceptable here secrets: inherit ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP204 target: ".github/workflows/pipeline.yml#jobs.build.secrets" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP204") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP204: off # or: secrets-inherit: error ``` Explain it in the terminal: ```sh flowpact explain FP204 ``` ## Related [#related] - [`FP203`](https://ciatlas.github.io/flowpact/docs/rules/fp203) unused-secret: A `workflow_call` secret is declared but never read. - [`FP205`](https://ciatlas.github.io/flowpact/docs/rules/fp205) undeclared-secret-ref: A reusable workflow reads a secret it does not declare, and some caller does not use `secrets: inherit`. # FP205 · undeclared-secret-ref (https://ciatlas.github.io/flowpact/docs/rules/fp205) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP205` | `undeclared-secret-ref` | Secrets | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Inside a called workflow only declared (or inherited) secrets exist. Reading anything else yields an empty string, so authentication steps fail late or, worse, fall back to anonymous access. ## How to fix [#how-to-fix] Declare the secret under `on.workflow_call.secrets` and pass it from every caller, or use `secrets: inherit`. Callers whose `with:` values make the reading job's or step's `if:` false (e.g. an omitted input in `if: contains(inputs.registries, 'docker.io')`) are not counted: the read never runs for them. Neither are reads under an `if:` that is always false (`if: false`). For a remote reusable workflow, which you cannot change: call it with `secrets: inherit` (it passes secrets within one organization or enterprise), ask its maintainers to declare the secret, or add an override. ## Example [#example] ```yaml on: workflow_call: {} # declares no secrets jobs: deploy: runs-on: ubuntu-latest steps: - run: ./deploy.sh env: TOKEN: ${{ secrets.DEPLOY_TOKEN }} # empty unless the caller uses secrets: inherit ``` ```yaml on: workflow_call: secrets: DEPLOY_TOKEN: required: true # and every caller passes it ``` ## Scope [#scope] Reads where GitHub allows no `secrets` (an input default, a `workflow_call` output, `jobs..with`, `if` or `name`) are refused rather than empty, and not reported. For a remote reusable workflow, the secrets come from the remote interfaces lockfile, which `flowpact remotes update` fills only with reads that run on every call: none under an `if:` (on the step, the job, or a job it needs), none in a condition. A secret the call passes by name is left to FP202. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP205] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP205] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP205 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP205") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP205: off # or: undeclared-secret-ref: error ``` Explain it in the terminal: ```sh flowpact explain FP205 ``` ## Related [#related] - [`FP204`](https://ciatlas.github.io/flowpact/docs/rules/fp204) secrets-inherit: `secrets: inherit` hands every repository secret to the callee; flowpact lists what is actually needed. - [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201) missing-required-secret: A reusable workflow is called without one of its required secrets. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP301 · undefined-output-ref (https://ciatlas.github.io/flowpact/docs/rules/fp301) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP301` | `undefined-output-ref` | Outputs | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`composite-actions`](https://github.com/ciatlas/flowpact/tree/main/fixtures/composite-actions) fixture: ```text ✖ ERROR FP301 undefined-output-ref Step "tools" runs after this step, so its outputs are not available yet ▶ .github/workflows/build.yml:9:30 ``` ## Why it matters [#why-it-matters] Undefined outputs evaluate to an empty string. Downstream jobs then run with missing versions, tags or flags. ## How to fix [#how-to-fix] Fix the output name, declare the output on the job/workflow/action, or reference the right job or step. In a composite action, a step writing to `$GITHUB_OUTPUT` sets its own output, not the action's: give the step an `id` and map the output under the action's `outputs:` (`value: ${{ steps..outputs. }}`). ## Example [#example] ```yaml jobs: build: outputs: version: ${{ steps.meta.outputs.version }} deploy: needs: build run: deploy ${{ needs.build.outputs.vesion }} ``` ```yaml run: deploy ${{ needs.build.outputs.version }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP301] why`): ```yaml title=".github/workflows/build.yml" # flowpact: ignore[FP301] why it is acceptable here - run: echo "tools ${{ steps.tools.outputs.version }}" ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP301 target: ".github/workflows/build.yml#jobs.build.steps.tools.outputs.version" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP301") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP301: off # or: undefined-output-ref: error ``` Explain it in the terminal: ```sh flowpact explain FP301 ``` ## Related [#related] - [`FP302`](https://ciatlas.github.io/flowpact/docs/rules/fp302) output-ref-without-needs: `needs.` is read where the `needs` context does not contain ``. - [`FP304`](https://ciatlas.github.io/flowpact/docs/rules/fp304) step-output-never-written: An output is read from a step whose inline script (`run:` or `actions/github-script`) writes other outputs, but never this one. - [`FP303`](https://ciatlas.github.io/flowpact/docs/rules/fp303) unused-output: A job output, or an output of an internal reusable workflow or action, is declared but nothing reads it. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP302 · output-ref-without-needs (https://ciatlas.github.io/flowpact/docs/rules/fp302) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP302` | `output-ref-without-needs` | Outputs | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ✖ ERROR FP302 output-ref-without-needs jobs.notify reads needs.build, which is empty here: "build" is not under needs, and only the job's `if:` sees jobs it depends on indirectly ▶ .github/workflows/pipeline.yml:39:33 ``` ## Why it matters [#why-it-matters] The `needs` context contains the jobs listed under `needs:`. Only the job's own `if:` also sees the jobs it depends on indirectly (through one of its needs); in steps, `env`, `with:`, `name` and the matrix their values are empty. A job that does not depend on `` at all may also run before it. ## How to fix [#how-to-fix] Add the job to `needs:` (it is fine to list transitive dependencies explicitly). ## Example [#example] ```yaml deploy: needs: test run: deploy ${{ needs.build.outputs.version }} ``` ```yaml deploy: needs: [build, test] ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP302] why`): ```yaml title=".github/workflows/pipeline.yml" # flowpact: ignore[FP302] why it is acceptable here - run: echo "deployed ${{ needs.build.outputs.artifact-url }}" ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP302 target: ".github/workflows/pipeline.yml#jobs.build" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP302") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP302: off # or: output-ref-without-needs: error ``` Explain it in the terminal: ```sh flowpact explain FP302 ``` ## Related [#related] - [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301) undefined-output-ref: An expression reads an output (`needs.*`, `jobs.*`, `steps.*`) that is never defined. - [`FP608`](https://ciatlas.github.io/flowpact/docs/rules/fp608) undefined-needs-job: A job lists a job under `needs:` that does not exist. # FP303 · unused-output (https://ciatlas.github.io/flowpact/docs/rules/fp303) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP303` | `unused-output` | Outputs | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`composite-actions`](https://github.com/ciatlas/flowpact/tree/main/fixtures/composite-actions) fixture: ```text ▲ WARN FP303 unused-output Output "cache_key" of .github/actions/install-tools is not read by any of its 1 user ▶ .github/actions/install-tools/action.yml:17:3 ``` ## Why it matters [#why-it-matters] Unused outputs suggest a broken hand-off: either the consumer reads a different name, or the output is dead code. ## How to fix [#how-to-fix] Remove the output, or make the intended consumer read it. ## Example [#example] ```yaml build: outputs: version: ${{ steps.meta.outputs.version }} digest: ${{ steps.push.outputs.digest }} # nothing reads needs.build.outputs.digest deploy: needs: build steps: - run: deploy ${{ needs.build.outputs.version }} ``` ```yaml build: outputs: version: ${{ steps.meta.outputs.version }} ``` ## Scope [#scope] Job outputs are always judged: only the jobs and workflow outputs of the same workflow can read them. Outputs of a reusable workflow or an action are judged only for an internal unit that this repository uses. Published units are not reported, because their consumers live in other repositories: reusable workflows (except files starting with `_`), the root `action.yml`, or exactly the units listed in `impact.publish` when it is set. Actions in subdirectories (`owner/repo/restore@v1`) count as internal unless `impact.publish` lists them. Reading the whole object (`toJSON(needs.build.outputs)`, `needs.build.outputs[matrix.key]`, `toJSON(steps)`) counts as reading every output. Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP303] why`): ```yaml title=".github/actions/install-tools/action.yml" # flowpact: ignore[FP303] why it is acceptable here cache_key: ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP303 target: ".github/actions/install-tools#outputs.cache_key" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP303") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP303: off # or: unused-output: error ``` Explain it in the terminal: ```sh flowpact explain FP303 ``` ## Related [#related] - [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301) undefined-output-ref: An expression reads an output (`needs.*`, `jobs.*`, `steps.*`) that is never defined. # FP304 · step-output-never-written (https://ciatlas.github.io/flowpact/docs/rules/fp304) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP304` | `step-output-never-written` | Outputs | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ▲ WARN FP304 step-output-never-written Step "sum" never writes output "sha" (it writes sha256) — did you mean "sha256"? ▶ .github/workflows/build.yml:22:21 ``` ## Why it matters [#why-it-matters] The read evaluates to an empty string. This is typically a typo in the `echo "name=value" >> $GITHUB_OUTPUT` line. ## How to fix [#how-to-fix] Write the output in the step (`echo "=" >> "$GITHUB_OUTPUT"`) or read the name it actually writes. ## Example [#example] ```yaml - id: meta run: echo "ver=1.2.3" >> "$GITHUB_OUTPUT" ... version: ${{ steps.meta.outputs.version }} ``` ```yaml - id: meta run: echo "version=1.2.3" >> "$GITHUB_OUTPUT" ``` ## Scope [#scope] Only scripts whose writes flowpact can name are judged. A step is skipped when its writes cannot be seen: `cat file >> "$GITHUB_OUTPUT"`, a computed name (`core.setOutput(name, …)`), or an `actions/github-script` script that loads a module (`require()`, `import()`; Node built-ins like `fs` aside), runs a program (`exec.exec()`), hands `core` to other code (`run({ core })`), or takes code from an expression (`script: ${{ inputs.code }}`). Words in strings, comments and template text do not count. Steps of other actions are not judged, since an action may set outputs of its own. Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP304] why`): ```yaml title=".github/workflows/build.yml" # flowpact: ignore[FP304] why it is acceptable here checksum: ${{ steps.sum.outputs.sha }} ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP304 target: ".github/workflows/build.yml#jobs.compile.steps.sum.outputs.sha" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP304") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP304: off # or: step-output-never-written: error ``` Explain it in the terminal: ```sh flowpact explain FP304 ``` ## Related [#related] - [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301) undefined-output-ref: An expression reads an output (`needs.*`, `jobs.*`, `steps.*`) that is never defined. # FP401 · empty-binding-for-matrix-combo (https://ciatlas.github.io/flowpact/docs/rules/fp401) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP401` | `empty-binding-for-matrix-combo` | Matrix | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`incident-matrix`](https://github.com/ciatlas/flowpact/tree/main/fixtures/incident-matrix) fixture: ```text ✖ ERROR FP401 empty-binding-for-matrix-combo Input "config" for .github/workflows/run-suite.yml is empty in 1 of 3 matrix combinations — matrix.config is not defined there ▶ .github/workflows/tests.yml:23:19 ``` ## Why it matters [#why-it-matters] GitHub evaluates a missing matrix key to an empty string — no error, no warning. The affected matrix leg runs with an empty input, so the callee may skip its real work (e.g. a test configuration) while the run stays green. ## How to fix [#how-to-fix] Define the key in every combination (add it to the `include` entry or a matrix dimension), or add an explicit fallback: `${{ matrix.key || 'default' }}`. ## Example [#example] ```yaml strategy: matrix: include: - name: linux config: ci-linux.json - name: windows # no "config" → empty input uses: ./.github/workflows/run-tests.yml # declares config: { required: true } with: config: ${{ matrix.config }} ``` ```yaml include: - name: linux config: ci-linux.json - name: windows config: ci-windows.json ``` ## Scope [#scope] Reported as an error when the input is required (or the callee is not in the repository) or when its default is empty (none, or `default: ''`) and an `if:` in the callee reads it, and as a warning when the empty value replaces a non-empty `default`. Not reported for other optional inputs (an empty default that no condition reads, or reads only through a fallback such as `inputs.x || 'all'`): the callee handles the empty value like an omitted input. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP401] why`): ```yaml title=".github/workflows/tests.yml" # flowpact: ignore[FP401] why it is acceptable here config: ${{ matrix.config }} ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP401 target: ".github/workflows/run-suite.yml#inputs.config" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP401") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP401: off # or: empty-binding-for-matrix-combo: error ``` Explain it in the terminal: ```sh flowpact explain FP401 ``` ## Related [#related] - [`FP402`](https://ciatlas.github.io/flowpact/docs/rules/fp402) matrix-key-missing-in-combo: An expression reads a matrix key that is only defined in some combinations. - [`FP404`](https://ciatlas.github.io/flowpact/docs/rules/fp404) undefined-matrix-key: An expression reads a matrix key that no combination defines (or the job has no matrix). - [`FP105`](https://ciatlas.github.io/flowpact/docs/rules/fp105) optional-input-no-default-in-condition: An optional input that is '' when omitted (no default, or `default: ''`) decides an `if:` by its truthiness. - [How matrices are expanded](https://ciatlas.github.io/flowpact/docs/how-it-works#4-expand-matrices--the-part-that-catches-silent-empties) # FP402 · matrix-key-missing-in-combo (https://ciatlas.github.io/flowpact/docs/rules/fp402) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP402` | `matrix-key-missing-in-combo` | Matrix | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`dynamic-matrix`](https://github.com/ciatlas/flowpact/tree/main/fixtures/dynamic-matrix) fixture: ```text ▲ WARN FP402 matrix-key-missing-in-combo matrix.shard is undefined in 2 of 3 combinations of jobs.sharded ▶ .github/workflows/matrix.yml:33:64 ``` ## Why it matters [#why-it-matters] In combinations without the key the value is an empty string. Scripts, env vars and runner labels built from it silently degrade (e.g. `--config=` with no value). ## How to fix [#how-to-fix] Define the key for every combination, or add a fallback (`${{ matrix.key || 'default' }}`). ## Example [#example] ```yaml strategy: matrix: include: - os: ubuntu-latest config: ci/linux.json - os: windows-latest # no config steps: - run: ./test.sh --config=${{ matrix.config }} ``` ```yaml steps: - run: ./test.sh --config=${{ matrix.config || 'ci/default.json' }} ``` ## Scope [#scope] Not reported: conditions (`if:`) and `continue-on-error`, comparisons and negations (`matrix.key != ''`, `!matrix.key`), `matrix.key && ...` guards, quoted shell tests in `run:` scripts (`[[ -z "${{ matrix.key }}" ]]`, `[ "${{ matrix.key }}" = on ]`), and combinations where the job or step is skipped by its own `if:`. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP402] why`): ```yaml title=".github/workflows/matrix.yml" # flowpact: ignore[FP402] why it is acceptable here - run: ./test.sh --suite ${{ matrix.suite }} --shard ${{ matrix.shard }} ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP402 target: ".github/workflows/matrix.yml#jobs.sharded.matrix.shard" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP402") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP402: off # or: matrix-key-missing-in-combo: error ``` Explain it in the terminal: ```sh flowpact explain FP402 ``` ## Related [#related] - [`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401) empty-binding-for-matrix-combo: An input passed under `with:` is empty for some matrix combinations because a matrix key is missing there. - [`FP404`](https://ciatlas.github.io/flowpact/docs/rules/fp404) undefined-matrix-key: An expression reads a matrix key that no combination defines (or the job has no matrix). - [How matrices are expanded](https://ciatlas.github.io/flowpact/docs/how-it-works#4-expand-matrices--the-part-that-catches-silent-empties) # FP403 · dynamic-matrix-unverified (https://ciatlas.github.io/flowpact/docs/rules/fp403) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP403` | `dynamic-matrix-unverified` | Matrix | 🔵 info | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`dynamic-matrix`](https://github.com/ciatlas/flowpact/tree/main/fixtures/dynamic-matrix) fixture: ```text ● INFO FP403 dynamic-matrix-unverified jobs.dynamic has a runtime-computed matrix; reads of matrix.os, matrix.config cannot be verified ▶ .github/workflows/matrix.yml:17:7 ``` ## Why it matters [#why-it-matters] Dynamic matrices (`fromJSON(...)`) hide the same empty-value failure mode as static ones, but no tool can see it. ## How to fix [#how-to-fix] Declare the keys in the config (`matrixShapes: { "#": { keys: [os, config] } }`) so flowpact can verify reads, prefer a static matrix, or validate the generated JSON in the job that produces it. ## Example [#example] ```yaml jobs: test: needs: setup strategy: matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} runs-on: ${{ matrix.os }} ``` ```yaml # .github/flowpact/flowpact.config.yml: the keys the generated matrix has matrixShapes: .github/workflows/test.yml#test: keys: [os] ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP403] why`): ```yaml title=".github/workflows/matrix.yml" # flowpact: ignore[FP403] why it is acceptable here matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP403 target: ".github/workflows/matrix.yml#jobs.dynamic" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP403") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP403: off # or: dynamic-matrix-unverified: error ``` Explain it in the terminal: ```sh flowpact explain FP403 ``` ## Related [#related] - [`FP405`](https://ciatlas.github.io/flowpact/docs/rules/fp405) unused-matrix-shape: A `matrixShapes` entry in the config does not match a job with a runtime-computed matrix. - [Matrix shapes](https://ciatlas.github.io/flowpact/docs/configuration#matrix-shapes) - [How matrices are expanded](https://ciatlas.github.io/flowpact/docs/how-it-works#4-expand-matrices--the-part-that-catches-silent-empties) # FP404 · undefined-matrix-key (https://ciatlas.github.io/flowpact/docs/rules/fp404) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP404` | `undefined-matrix-key` | Matrix | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`dynamic-matrix`](https://github.com/ciatlas/flowpact/tree/main/fixtures/dynamic-matrix) fixture: ```text ✖ ERROR FP404 undefined-matrix-key matrix.sute is not defined in any combination of jobs.sharded (keys: suite, shard, experimental) ▶ .github/workflows/matrix.yml:36:24 ``` ## Why it matters [#why-it-matters] The value is always empty — almost certainly a typo or a key that was renamed in the matrix. A comparison or test on it always gives the same answer, and a condition on it never changes. Only a read with a fallback that is not empty (`matrix.key || 'default'`) is info, since the fallback always applies, unless the key is close to one the matrix defines. ## How to fix [#how-to-fix] Fix the key name, add it to the matrix, or drop the read if the fallback is what you want. ## Example [#example] ```yaml strategy: matrix: suite: [unit, integration] steps: - run: npm test -- --suite ${{ matrix.sute }} # no combination defines "sute" ``` ```yaml - run: npm test -- --suite ${{ matrix.suite }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP404] why`): ```yaml title=".github/workflows/matrix.yml" # flowpact: ignore[FP404] why it is acceptable here - run: echo "${{ matrix.sute }}" ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP404 target: ".github/workflows/matrix.yml#jobs.sharded.matrix.sute" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP404") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP404: off # or: undefined-matrix-key: error ``` Explain it in the terminal: ```sh flowpact explain FP404 ``` ## Related [#related] - [`FP402`](https://ciatlas.github.io/flowpact/docs/rules/fp402) matrix-key-missing-in-combo: An expression reads a matrix key that is only defined in some combinations. - [How matrices are expanded](https://ciatlas.github.io/flowpact/docs/how-it-works#4-expand-matrices--the-part-that-catches-silent-empties) # FP405 · unused-matrix-shape (https://ciatlas.github.io/flowpact/docs/rules/fp405) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP405` | `unused-matrix-shape` | Matrix | 🟡 warning | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] A mistyped workflow path or job id means the shape is silently ignored and the matrix stays unverified. ## How to fix [#how-to-fix] Use `#` exactly as in the repository (e.g. `.github/workflows/test.yml#test`), or remove the entry. ## Example [#example] ```yaml # .github/flowpact/flowpact.config.yml matrixShapes: .github/workflows/tests.yml#test: # the workflow is test.yml keys: [os] ``` ```yaml matrixShapes: .github/workflows/test.yml#test: keys: [os] ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP405] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP405] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP405 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP405") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP405: off # or: unused-matrix-shape: error ``` Explain it in the terminal: ```sh flowpact explain FP405 ``` ## Related [#related] - [`FP403`](https://ciatlas.github.io/flowpact/docs/rules/fp403) dynamic-matrix-unverified: The matrix is computed at runtime, so flowpact cannot check that every combination defines the keys it reads. - [Matrix shapes](https://ciatlas.github.io/flowpact/docs/configuration#matrix-shapes) # FP406 · matrix-too-large (https://ciatlas.github.io/flowpact/docs/rules/fp406) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP406` | `matrix-too-large` | Matrix | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] GitHub generates at most 256 jobs per matrix (after `exclude` and `include`) and fails the workflow run otherwise. ## How to fix [#how-to-fix] Split the job, drop dimensions or values, or `exclude` combinations you do not need. ## Example [#example] ```yaml strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] node: [18, 20, 22, 24] shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] # 3 × 4 × 22 = 264 jobs ``` ```yaml node: [20, 22, 24] # 3 × 3 × 22 = 198 jobs ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP406] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP406] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP406 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP406") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP406: off # or: matrix-too-large: error ``` Explain it in the terminal: ```sh flowpact explain FP406 ``` ## Related [#related] - [`FP403`](https://ciatlas.github.io/flowpact/docs/rules/fp403) dynamic-matrix-unverified: The matrix is computed at runtime, so flowpact cannot check that every combination defines the keys it reads. - [How matrices are expanded](https://ciatlas.github.io/flowpact/docs/how-it-works#4-expand-matrices--the-part-that-catches-silent-empties) # FP501 · undefined-env-ref (https://ciatlas.github.io/flowpact/docs/rules/fp501) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP501` | `undefined-env-ref` | Env & expressions | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`deep-nesting`](https://github.com/ciatlas/flowpact/tree/main/fixtures/deep-nesting) fixture: ```text ▲ WARN FP501 undefined-env-ref env.TARGET_URL is not defined in this scope ▶ .github/workflows/publish.yml:34:36 ``` ## Why it matters [#why-it-matters] The `env` context only contains variables set by the workflow itself — not runner defaults like `GITHUB_SHA`. Reads of anything else evaluate to an empty string. ## How to fix [#how-to-fix] Define the variable under `env:`, write it to `$GITHUB_ENV` in an earlier step, or use the matching context (e.g. `github.sha`). ## Example [#example] ```yaml run: echo ${{ env.GITHUB_SHA }} ``` ```yaml run: echo ${{ github.sha }} # or "$GITHUB_SHA" in the shell ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP501] why`): ```yaml title=".github/workflows/publish.yml" # flowpact: ignore[FP501] why it is acceptable here - run: echo "uploaded to ${{ env.TARGET_URL }}" ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP501 target: ".github/workflows/publish.yml#jobs.upload.env.TARGET_URL" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP501") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP501: off # or: undefined-env-ref: error ``` Explain it in the terminal: ```sh flowpact explain FP501 ``` # FP502 · expression-parse-error (https://ciatlas.github.io/flowpact/docs/rules/fp502) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP502` | `expression-parse-error` | Env & expressions | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`broken`](https://github.com/ciatlas/flowpact/tree/main/fixtures/broken) fixture: ```text ✖ ERROR FP502 expression-parse-error Invalid expression "inputs.mode = 'release'": Unexpected symbol: '=' ▶ .github/workflows/expressions.yml:10:25 ``` ## Why it matters [#why-it-matters] GitHub rejects the workflow when it is triggered, or fails the step that contains the expression. ## How to fix [#how-to-fix] Fix the syntax: strings use single quotes, `==` for equality, and every `${{` needs a closing `}}`. ## Example [#example] ```yaml if: ${{ inputs.mode = "release" }} ``` ```yaml if: ${{ inputs.mode == 'release' }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP502] why`): ```yaml title=".github/workflows/expressions.yml" # flowpact: ignore[FP502] why it is acceptable here if: ${{ inputs.mode = 'release' }} ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP502 file: ".github/workflows/expressions.yml" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP502") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP502: off # or: expression-parse-error: error ``` Explain it in the terminal: ```sh flowpact explain FP502 ``` ## Related [#related] - [`FP503`](https://ciatlas.github.io/flowpact/docs/rules/fp503) schema-violation: The file does not match GitHub’s workflow / action schema (validated with GitHub’s own parser). - [`FP505`](https://ciatlas.github.io/flowpact/docs/rules/fp505) context-not-available: An expression uses a context or function that GitHub does not allow in that field (e.g. `env` in a reusable workflow call’s `with:`). # FP503 · schema-violation (https://ciatlas.github.io/flowpact/docs/rules/fp503) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP503` | `schema-violation` | Env & expressions | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`broken`](https://github.com/ciatlas/flowpact/tree/main/fixtures/broken) fixture: ```text ✖ ERROR FP503 schema-violation Unexpected value 'stepz' ▶ .github/workflows/schema.yml:6:5 ``` ## Why it matters [#why-it-matters] GitHub refuses to run a workflow or action with schema errors, often only when the trigger fires. Some keys it accepts and ignores instead, such as a top-level `env:` in action.yml, a filter the event does not support or a YAML merge key under an event. Those are reported as warnings: the file runs, but without the setting. The configured severity caps both kinds, so `FP503: warning` also reports schema errors as warnings, and ignored keys are never reported above warning. ## How to fix [#how-to-fix] Correct the key or value reported. Most messages come from @actions/workflow-parser, the parser GitHub’s tooling uses; for a key GitHub ignores, the warning says what is lost and how to fix it. ## Example [#example] ```yaml # action.yml env: UV_VERSION: 0.9.0 # ignored: actions have no top-level env runs: using: composite steps: - uses: astral-sh/setup-uv@v7 with: version: ${{ env.UV_VERSION }} ``` ```yaml # action.yml inputs: uv-version: default: 0.9.0 runs: using: composite steps: - uses: astral-sh/setup-uv@v7 with: version: ${{ inputs.uv-version }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP503] why`): ```yaml title=".github/workflows/schema.yml" # flowpact: ignore[FP503] why it is acceptable here stepz: ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP503 file: ".github/workflows/schema.yml" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP503") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP503: off # or: schema-violation: error ``` Explain it in the terminal: ```sh flowpact explain FP503 ``` ## Related [#related] - [`FP502`](https://ciatlas.github.io/flowpact/docs/rules/fp502) expression-parse-error: A `${{ }}` expression (or an `if:` condition) cannot be parsed. - [`FP504`](https://ciatlas.github.io/flowpact/docs/rules/fp504) yaml-syntax-error: The file is not valid YAML. # FP504 · yaml-syntax-error (https://ciatlas.github.io/flowpact/docs/rules/fp504) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP504` | `yaml-syntax-error` | Env & expressions | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Nothing in the file can run, and every analysis of it is incomplete. ## How to fix [#how-to-fix] Fix the YAML syntax at the reported position (indentation, a `: ` inside an unquoted value, duplicate keys). ## Example [#example] ```yaml steps: - run: echo Deploying to: production # a second ": " in an unquoted value ``` ```yaml steps: - run: 'echo Deploying to: production' ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP504] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP504] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP504 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP504") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP504: off # or: yaml-syntax-error: error ``` Explain it in the terminal: ```sh flowpact explain FP504 ``` ## Related [#related] - [`FP503`](https://ciatlas.github.io/flowpact/docs/rules/fp503) schema-violation: The file does not match GitHub’s workflow / action schema (validated with GitHub’s own parser). # FP505 · context-not-available (https://ciatlas.github.io/flowpact/docs/rules/fp505) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP505` | `context-not-available` | Env & expressions | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] GitHub only makes some contexts available per field. `env` is not passed to reusable workflows and cannot be used in `jobs..with` or `jobs..if`; `secrets` cannot be used in `if:`. GitHub rejects the whole workflow when it is triggered — often only on the branch or event that reaches it. Reported by GitHub’s own parser. ## How to fix [#how-to-fix] Use a context that is available there: pass values through `inputs`/`vars`, compute them in an earlier job and read `needs..outputs`, or move the check into a step (`if: env.X == ...` works in steps). ## Example [#example] ```yaml env: TARGET: prod jobs: deploy: uses: ./.github/workflows/deploy.yml with: target: ${{ env.TARGET }} # env is not available here ``` ```yaml jobs: deploy: uses: ./.github/workflows/deploy.yml with: target: ${{ vars.TARGET }} ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP505] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP505] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP505 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP505") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP505: off # or: context-not-available: error ``` Explain it in the terminal: ```sh flowpact explain FP505 ``` ## Related [#related] - [`FP502`](https://ciatlas.github.io/flowpact/docs/rules/fp502) expression-parse-error: A `${{ }}` expression (or an `if:` condition) cannot be parsed. # FP506 · value-not-boolean (https://ciatlas.github.io/flowpact/docs/rules/fp506) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP506` | `value-not-boolean` | Env & expressions | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`boolean-values`](https://github.com/ciatlas/flowpact/tree/main/fixtures/boolean-values) fixture: ```text ▲ WARN FP506 value-not-boolean `needs.scan.outputs.is-report` is compared with `'true'`, but it can hold other text, and the comparison is then false: it is 'true' | text of `inputs.report-file` | '' (`inputs.report-file` omitted) ▶ .github/workflows/ci.yml:13:9 ``` ## Why it matters [#why-it-matters] Only an `if:` reads a value as true or false. Under `env:`, `with:` and `outputs:` a value is passed on as text: a comparison gives 'true' or 'false', but `a || b` gives the operand itself, and an optional input is '' when omitted. `fromJSON('')` fails the job (`continue-on-error: ${{ fromJSON(env.X) }}` is the usual reader), and so does `fromJSON()` of a file name. A reader that compares the value with 'true' takes the false branch for any other text, and the run stays green. Reported as an error for `fromJSON()`, as a warning otherwise. ## How to fix [#how-to-fix] Compare explicitly where the value is set, so that it is 'true' or 'false': `inputs.x != ''` (or `inputs.x == 'yes'`). A literal fallback (`inputs.x || 'false'`) only fixes the empty case. The editor offers `!= ''` as a quick fix where it is certain. ## Example [#example] ```yaml - env: CONTINUE_ON_ERROR: ${{ inputs.report-file }} continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }} run: ./test.sh outputs: is-report: ${{ steps.changed.outputs.any == 'true' || inputs.report-file }} ``` ```yaml - env: CONTINUE_ON_ERROR: ${{ inputs.report-file != '' }} continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }} run: ./test.sh outputs: is-report: ${{ steps.changed.outputs.any == 'true' || inputs.report-file != '' }} ``` ## Scope [#scope] `fromJSON()` is reported only for a '' flowpact can point at: an optional input without a default (or with `default: ''`) that a caller can omit (as for FP105, not one every local caller passes, unless the workflow can be dispatched or the unit is published), or the output of a step whose `if:` can skip it; not when the reader's own job or step `if:`, or an earlier operand of its `&&`, `||` or `case()`, reads the same input, output or `github` property. In a field that takes a boolean (`continue-on-error:`, a `type: boolean` input) such an input is reported even when every local caller passes it, since other text than 'true' or 'false' fails there too, unless each passes 'true' or 'false' as it is, or one expression that gives a boolean in the caller (`${{ inputs.dry }}` of an input every trigger of the caller declares `type: boolean`, a comparison, `!`, `contains()`). The `||` is reported when one of its operands is a boolean (a comparison, `!`, `contains()`, a boolean input, or 'true'/'false') and another is text; not `c && 'yes' || 'no'`, which is always text, nor an `&&` alone. Values known only at run time (a script’s outputs, `github.event`, the matrix) are never reported. Not reported either: comparisons in a `run:` script (`[[ "$X" == "true" ]]`), the fall-through of `c && a || b` when `a` is '', a value that is always 'true' or 'false' read by an `if:` (where 'false' is true), and text passed in `with:` to a `type: boolean` input. The quick fix is offered for a value written on one line, where each text operand is a reference that is text or '', and for `fromJSON()` only where it must give a boolean: `continue-on-error:`, a condition, or a `type: boolean` input. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP506] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP506] why it is acceptable here if: needs.scan.outputs.is-report == 'true' ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP506 target: ".github/workflows/ci.yml#jobs.scan.outputs.is-report" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP506") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP506: off # or: value-not-boolean: error ``` Explain it in the terminal: ```sh flowpact explain FP506 ``` ## Related [#related] - [`FP507`](https://ciatlas.github.io/flowpact/docs/rules/fp507) redundant-empty-comparison: A condition compares a value with `''` (`!= ''`, `== ''`), which `if:` already does by itself. - [`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103) input-type-mismatch: A literal value passed to a typed `workflow_call` input has the wrong type. # FP507 · redundant-empty-comparison (https://ciatlas.github.io/flowpact/docs/rules/fp507) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP507` | `redundant-empty-comparison` | Env & expressions | ⚪ off (opt-in) | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] An `if:` treats `''`, `null`, `0` and `false` as false and every other value as true, so `x != ''` decides it the same way as `x`, and `x == ''` as `!x`. Outside a condition the comparison matters: under `env:`, `with:` or `outputs:` it turns the value into `true` or `false`, and `continue-on-error:` accepts only a boolean. ## How to fix [#how-to-fix] Remove the comparison: `x != ''` becomes `x`, and `x == ''` becomes `!x`. The editor offers it as a quick fix where the change is certain. ## Example [#example] ```yaml if: ${{ steps.patch.outputs.file != '' && steps.check.outputs.skip == '' }} ``` ```yaml if: ${{ steps.patch.outputs.file && !steps.check.outputs.skip }} ``` ## Scope [#scope] Only a comparison with the string `''` that decides the condition: the whole `if:`, or an operand of `!`, `&&` or `||` in it. Not `!= null`, `!= 0` or `!= false`, which differ for `'0'`; not inside a comparison, a function's arguments (`case()` requires real booleans) or an `if:` with text around its `${{ }}`, which is always true; not under `env:`, `with:`, `outputs:` or `continue-on-error:`. While FP105 runs, not for an optional input without a default: FP105 reports one decided by its truthiness, and counts `!= ''` as handling the omitted case. Nor a condition that a YAML alias shares with another key (`if: *flag`), whose text may be a value. Off by default: the comparison is harmless, and some prefer it written out; turn it on with `FP507: info`. The quick fix is offered for a condition written on one line, not in a single-quoted YAML string, in a file with LF line endings; not for a value in parentheses (`(a || b) != ''`) or a matrix value (YAML's `.nan` compares otherwise), nor when the condition would then start with `!` without `${{ }}`, which YAML reads as a tag. Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP507] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP507] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP507 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP507") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP507: warning # or: redundant-empty-comparison: error ``` Explain it in the terminal: ```sh flowpact explain FP507 ``` ## Related [#related] - [`FP105`](https://ciatlas.github.io/flowpact/docs/rules/fp105) optional-input-no-default-in-condition: An optional input that is '' when omitted (no default, or `default: ''`) decides an `if:` by its truthiness. - [`FP506`](https://ciatlas.github.io/flowpact/docs/rules/fp506) value-not-boolean: A value read as a boolean can be another string: `fromJSON()` of a value that may be '', a comparison with 'true' of a value that may be other text, or an `env:`, `with:` or `outputs:` value that gives a boolean or text. # FP601 · call-cycle (https://ciatlas.github.io/flowpact/docs/rules/fp601) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP601` | `call-cycle` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`cycles`](https://github.com/ciatlas/flowpact/tree/main/fixtures/cycles) fixture: ```text ✖ ERROR FP601 call-cycle Call cycle: .github/workflows/b.yml → .github/workflows/c.yml → .github/workflows/b.yml ▶ .github/workflows/c.yml:5:11 ``` ## Why it matters [#why-it-matters] GitHub rejects recursive reusable workflow calls when the run starts. ## How to fix [#how-to-fix] Break the cycle by extracting the shared jobs into a separate workflow that neither side calls back. ## Example [#example] ```yaml # .github/workflows/test.yml, which build.yml calls on: workflow_call jobs: package: uses: ./.github/workflows/build.yml # build.yml calls test.yml: a cycle ``` ```yaml # .github/workflows/test.yml calls nothing back on: workflow_call jobs: unit: runs-on: ubuntu-latest steps: - run: npm test ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP601] why`): ```yaml title=".github/workflows/c.yml" # flowpact: ignore[FP601] why it is acceptable here uses: ./.github/workflows/b.yml ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP601 target: ".github/workflows/b.yml" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP601") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP601: off # or: call-cycle: error ``` Explain it in the terminal: ```sh flowpact explain FP601 ``` ## Related [#related] - [`FP602`](https://ciatlas.github.io/flowpact/docs/rules/fp602) nesting-depth: A chain of reusable workflow calls is deeper than the configured limit (`limits.nestingDepth`). # FP602 · nesting-depth (https://ciatlas.github.io/flowpact/docs/rules/fp602) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP602` | `nesting-depth` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] GitHub limits how deeply reusable workflows can be nested and fails the run when the limit is exceeded. Deep chains are also where values get lost between levels. ## How to fix [#how-to-fix] Flatten the chain (call leaf workflows directly from a higher level). GitHub allows at most 10 levels; lower `limits.nestingDepth` to enforce a stricter internal limit. ## Example [#example] ```yaml # .github/flowpact/flowpact.config.yml limits: nestingDepth: 4 # ci.yml → build.yml → package.yml → publish.yml → sign.yml: 5 workflows ``` ```yaml # .github/workflows/ci.yml calls the leaf workflows itself jobs: build: uses: ./.github/workflows/build.yml publish: needs: build uses: ./.github/workflows/publish.yml ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP602] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP602] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP602 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP602") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP602: off # or: nesting-depth: error ``` Explain it in the terminal: ```sh flowpact explain FP602 ``` ## Related [#related] - [`FP601`](https://ciatlas.github.io/flowpact/docs/rules/fp601) call-cycle: Reusable workflows call each other in a cycle. # FP603 · remote-unverified (https://ciatlas.github.io/flowpact/docs/rules/fp603) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP603` | `remote-unverified` | Graph structure | 🔵 info | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`cycles`](https://github.com/ciatlas/flowpact/tree/main/fixtures/cycles) fixture: ```text ● INFO FP603 remote-unverified jobs.remote calls remote workflow octo-org/shared/.github/workflows/lint.yml@v2; its interface is not verified ▶ .github/workflows/main.yml:10:11 ``` ## Why it matters [#why-it-matters] flowpact analyzes this repository only, so inputs, secrets and outputs of the remote workflow are taken on trust, unless `.github/flowpact/remotes.lock.yaml` records its interface. ## How to fix [#how-to-fix] Run `flowpact remotes update` to record its interface and have it checked, or nothing. If the workflow lives in this repository, set `repository: owner/repo` in the config so it resolves locally. ## Example [#example] ```yaml jobs: lint: uses: octo-org/shared/.github/workflows/lint.yml@v2 # no entry in the lockfile with: strict: true ``` ```yaml # after `flowpact remotes update`: .github/flowpact/remotes.lock.yaml remotes: octo-org/shared/.github/workflows/lint.yml@v2: sha: 0123456789abcdef0123456789abcdef01234567 kind: workflow inputs: strict: type: boolean ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP603] why`): ```yaml title=".github/workflows/main.yml" # flowpact: ignore[FP603] why it is acceptable here uses: octo-org/shared/.github/workflows/lint.yml@v2 ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP603 target: "remote:octo-org/shared/.github/workflows/lint.yml@v2" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP603") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP603: off # or: remote-unverified: error ``` Explain it in the terminal: ```sh flowpact explain FP603 ``` ## Related [#related] - [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) remotes-lock-outdated: The remote interfaces lockfile lacks a remote workflow or action the repository uses, has one it no longer uses, or records another commit than the one a reference pins or GitHub’s actions.lock runs. - [`FP611`](https://ciatlas.github.io/flowpact/docs/rules/fp611) remotes-lock-invalid: The remote interfaces lockfile does not parse, or does not match its schema. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP604 · needs-without-data (https://ciatlas.github.io/flowpact/docs/rules/fp604) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP604` | `needs-without-data` | Graph structure | ⚪ off (opt-in) | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Ordering-only dependencies are legitimate (deploy after test), but unexplained ones serialize the pipeline. This rule is off by default; enable it to audit the critical path. ## How to fix [#how-to-fix] Remove the dependency if it is not needed for ordering, or keep it and disable the rule for that job. ## Example [#example] ```yaml jobs: lint: runs-on: ubuntu-latest steps: - run: npm run lint test: needs: lint # reads nothing from lint, and waits for it runs-on: ubuntu-latest steps: - run: npm test ``` ```yaml test: runs-on: ubuntu-latest # runs next to lint steps: - run: npm test ``` ## Scope [#scope] Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP604] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP604] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP604 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP604") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP604: warning # or: needs-without-data: error ``` Explain it in the terminal: ```sh flowpact explain FP604 ``` ## Related [#related] - [`FP302`](https://ciatlas.github.io/flowpact/docs/rules/fp302) output-ref-without-needs: `needs.` is read where the `needs` context does not contain ``. # FP605 · large-interface (https://ciatlas.github.io/flowpact/docs/rules/fp605) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP605` | `large-interface` | Graph structure | 🔵 info | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Interfaces with dozens of inputs are where forgotten bindings and dead knobs hide. Related values are easier to keep consistent when grouped. ## How to fix [#how-to-fix] Group related inputs into one JSON input (`fromJSON(inputs.test-config)`), split the workflow, or move constants into the callee. ## Example [#example] ```yaml on: workflow_call: inputs: node-version: { type: string } os: { type: string } coverage: { type: boolean } shard-count: { type: number } # … 30 more ``` ```yaml on: workflow_call: inputs: test-config: { type: string, required: true } # JSON: {"node": "22", "os": "ubuntu-latest", …} jobs: test: runs-on: ${{ fromJSON(inputs.test-config).os }} ``` ## Scope [#scope] Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP605] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP605] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP605 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP605") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP605: off # or: large-interface: error ``` Explain it in the terminal: ```sh flowpact explain FP605 ``` # FP606 · missing-local-target (https://ciatlas.github.io/flowpact/docs/rules/fp606) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP606` | `missing-local-target` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`cycles`](https://github.com/ciatlas/flowpact/tree/main/fixtures/cycles) fixture: ```text ✖ ERROR FP606 missing-local-target Workflow ".github/workflows/does-not-exist.yml" does not exist ▶ .github/workflows/main.yml:8:11 ``` ## Why it matters [#why-it-matters] The job or step fails as soon as it is reached, usually after a rename or move. A step’s `./path` is relative to the runner’s workspace: flowpact maps it through the `actions/checkout` steps before it (for a composite action, each caller’s) and reports it when it lands in this repository but is missing, or when no checkout puts this repository where it points. Paths it cannot read are FP610. ## How to fix [#how-to-fix] Fix the path or restore the missing file. A step’s `./path` includes the `path:` this repository is checked out to, and needs a checkout that puts it there; `$/path` and a job’s `./path` are relative to the repository root whatever the checkout, and `$/` takes no `@ref` (it always runs the running commit). ## Example [#example] ```yaml - uses: actions/checkout@v5 with: path: src/app - uses: ./src/app/.github/actions/biuld ``` ```yaml - uses: actions/checkout@v5 with: path: src/app - uses: ./src/app/.github/actions/build # or, whatever the checkout: - uses: $/.github/actions/build ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP606] why`): ```yaml title=".github/workflows/main.yml" # flowpact: ignore[FP606] why it is acceptable here uses: ./.github/workflows/does-not-exist.yml ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP606 target: ".github/workflows/does-not-exist.yml" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP606") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP606: off # or: missing-local-target: error ``` Explain it in the terminal: ```sh flowpact explain FP606 ``` ## Related [#related] - [`FP610`](https://ciatlas.github.io/flowpact/docs/rules/fp610) workspace-unverified: A step’s `uses: ./...` points to a place in the runner’s workspace that flowpact cannot read, so the action is not verified. # FP607 · unreferenced-reusable-workflow (https://ciatlas.github.io/flowpact/docs/rules/fp607) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP607` | `unreferenced-reusable-workflow` | Graph structure | 🔵 info | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] It is either dead code or called from other repositories — worth knowing before changing its interface. ## How to fix [#how-to-fix] Delete it if unused; otherwise document its external callers. ## Example [#example] ```yaml # .github/workflows/old-release.yml: nothing in this repository calls it on: workflow_call jobs: release: runs-on: ubuntu-latest steps: - run: ./release.sh ``` ```yaml # Deleted; or, when other repositories call it, kept with a note of who does: # .github/workflows/release.yml, called by acme/app and acme/site on: workflow_call ``` ## Scope [#scope] Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP607] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP607] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP607 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP607") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP607: off # or: unreferenced-reusable-workflow: error ``` Explain it in the terminal: ```sh flowpact explain FP607 ``` ## Related [#related] - [`FP609`](https://ciatlas.github.io/flowpact/docs/rules/fp609) callee-not-reusable: A job calls a local workflow that has no `on.workflow_call` trigger. # FP608 · undefined-needs-job (https://ciatlas.github.io/flowpact/docs/rules/fp608) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP608` | `undefined-needs-job` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`cycles`](https://github.com/ciatlas/flowpact/tree/main/fixtures/cycles) fixture: ```text ✖ ERROR FP608 undefined-needs-job jobs.report needs "linting", which is not a job in .github/workflows/main.yml (jobs: stage-b, missing, remote, report) ▶ .github/workflows/main.yml:12:22 ``` ## Why it matters [#why-it-matters] GitHub rejects the workflow when it is triggered. ## How to fix [#how-to-fix] Fix the job id or remove the dependency. ## Example [#example] ```yaml jobs: build: runs-on: ubuntu-latest steps: - run: make deploy: needs: biuld # no job "biuld" runs-on: ubuntu-latest steps: - run: make deploy ``` ```yaml deploy: needs: build ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP608] why`): ```yaml title=".github/workflows/main.yml" # flowpact: ignore[FP608] why it is acceptable here needs: [stage-b, linting] ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP608 target: ".github/workflows/main.yml#jobs.linting" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP608") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP608: off # or: undefined-needs-job: error ``` Explain it in the terminal: ```sh flowpact explain FP608 ``` ## Related [#related] - [`FP302`](https://ciatlas.github.io/flowpact/docs/rules/fp302) output-ref-without-needs: `needs.` is read where the `needs` context does not contain ``. # FP609 · callee-not-reusable (https://ciatlas.github.io/flowpact/docs/rules/fp609) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP609` | `callee-not-reusable` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Only workflows with `workflow_call` can be called. GitHub rejects the caller ("is not a reusable workflow"), and none of the callee’s `workflow_dispatch` inputs count as a call interface. ## How to fix [#how-to-fix] Add `on: workflow_call:` (with the inputs, secrets and outputs the callers need) to the called workflow, or call the right file. ## Example [#example] ```yaml # deploy.yml on: workflow_dispatch: inputs: target: { type: string, required: true } ``` ```yaml on: workflow_dispatch: ... workflow_call: inputs: target: { type: string, required: true } ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP609] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP609] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP609 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP609") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP609: off # or: callee-not-reusable: error ``` Explain it in the terminal: ```sh flowpact explain FP609 ``` ## Related [#related] - [`FP607`](https://ciatlas.github.io/flowpact/docs/rules/fp607) unreferenced-reusable-workflow: A workflow can only be triggered by `workflow_call`, but nothing in this repository calls it. # FP610 · workspace-unverified (https://ciatlas.github.io/flowpact/docs/rules/fp610) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP610` | `workspace-unverified` | Graph structure | 🔵 info | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] GitHub resolves a step’s `./path` against the workspace, not the repository. When the path lies in another repository’s checkout, in a checkout of this repository at another ref, outside the workspace, where an earlier step’s script writes, or where no checkout of this repository puts it, flowpact cannot read the action: its inputs, outputs and the path itself are taken on trust. ## How to fix [#how-to-fix] Nothing to fix if this is intended. To have it checked, reference another repository’s action as `owner/repo/path@ref`, and this repository’s as `$/path` (or check this repository out where the path points). ## Example [#example] ```yaml - uses: actions/checkout@v5 with: repository: acme/shared-actions path: shared - uses: ./shared/setup ``` ```yaml - uses: acme/shared-actions/setup@v2 ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP610] why`): ```yaml title=".github/workflows/ci.yml" # flowpact: ignore[FP610] why it is acceptable here ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP610 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP610") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP610: off # or: workspace-unverified: error ``` Explain it in the terminal: ```sh flowpact explain FP610 ``` ## Related [#related] - [`FP606`](https://ciatlas.github.io/flowpact/docs/rules/fp606) missing-local-target: A local `uses: ./...` or `uses: $/...` points to a workflow or action that does not exist where GitHub looks for it, or is written in a form GitHub rejects. # FP611 · remotes-lock-invalid (https://ciatlas.github.io/flowpact/docs/rules/fp611) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP611` | `remotes-lock-invalid` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] flowpact then checks no remote call against an interface: every remote reusable workflow and action is taken on trust, as without a lockfile. ## How to fix [#how-to-fix] Run `flowpact remotes update` to write it again, or fix the entry the message names. ## Example [#example] ```yaml # .github/flowpact/remotes.lock.yaml version: 1 remotes: octo/setup@v2: sha: v2 # not a commit SHA kind: action ``` ```yaml # written again by `flowpact remotes update` version: 1 remotes: octo/setup@v2: sha: 0123456789abcdef0123456789abcdef01234567 kind: action ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP611 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP611") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP611: off # or: remotes-lock-invalid: error ``` Explain it in the terminal: ```sh flowpact explain FP611 ``` ## Related [#related] - [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) remotes-lock-outdated: The remote interfaces lockfile lacks a remote workflow or action the repository uses, has one it no longer uses, or records another commit than the one a reference pins or GitHub’s actions.lock runs. - [`FP603`](https://ciatlas.github.io/flowpact/docs/rules/fp603) remote-unverified: A job calls a reusable workflow in another repository whose interface is not in the remote interfaces lockfile. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP612 · remotes-lock-outdated (https://ciatlas.github.io/flowpact/docs/rules/fp612) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP612` | `remotes-lock-outdated` | Graph structure | 🟡 warning | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] A reference the lockfile lacks is not checked (unless `--fetch-remotes` or the action’s `remotes: fetch` fetches it for the run). It happens when a reference moves to another version, for example in a pull request from Renovate or Dependabot, until the lockfile is updated. A reference pinned to a full commit SHA (`octo/setup@`) runs that commit, so an entry that records another one describes other code: it is not used, and the calls are not checked. `flowpact remotes update` never writes such an entry; an edit to the lockfile did. A reference that GitHub’s `.github/workflows/actions.lock` pins runs the commit it records, even after its tag moves: an entry that records another one (the bot that updated `actions.lock` left the lockfile as it was) is still used, though it may describe other inputs than run. ## How to fix [#how-to-fix] Run `flowpact remotes update` and commit the lockfile (see the Renovate and Dependabot recipes in the docs). ## Example [#example] ```yaml # a workflow now uses octo/setup@v3; the lockfile still records @v2 version: 1 remotes: octo/setup@v2: sha: 0123456789abcdef0123456789abcdef01234567 kind: action ``` ```yaml # after `flowpact remotes update` version: 1 remotes: octo/setup@v3: sha: 89abcdef0123456789abcdef0123456789abcdef kind: action ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP612 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP612") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP612: off # or: remotes-lock-outdated: error ``` Explain it in the terminal: ```sh flowpact explain FP612 ``` ## Related [#related] - [`FP603`](https://ciatlas.github.io/flowpact/docs/rules/fp603) remote-unverified: A job calls a reusable workflow in another repository whose interface is not in the remote interfaces lockfile. - [`FP611`](https://ciatlas.github.io/flowpact/docs/rules/fp611) remotes-lock-invalid: The remote interfaces lockfile does not parse, or does not match its schema. - [`FP614`](https://ciatlas.github.io/flowpact/docs/rules/fp614) actions-lock-unreadable: GitHub’s `.github/workflows/actions.lock` does not parse, or has a schema version flowpact does not read. - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP613 · ungranted-permissions (https://ciatlas.github.io/flowpact/docs/rules/fp613) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP613` | `ungranted-permissions` | Graph structure | 🔴 error | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`call-permissions`](https://github.com/ciatlas/flowpact/tree/main/fixtures/call-permissions) fixture: ```text ✖ ERROR FP613 ungranted-permissions .github/workflows/publish.yml › jobs.npm requests contents: write, packages: write, but jobs.publish grants contents: read, packages: none ▶ .github/workflows/release.yml:5:1 ``` ## Why it matters [#why-it-matters] A called workflow's jobs run with the caller's `GITHUB_TOKEN` and can only keep or lower its permissions. GitHub refuses the whole run when it starts ("The nested job … is requesting 'contents: write', but is only allowed 'contents: read'"). ## How to fix [#how-to-fix] Grant the permission in the calling job's `permissions:`; a job's `permissions:` replaces the workflow's for that job only. If the called job does not need it, lower its `permissions:` instead. ## Example [#example] ```yaml permissions: contents: read jobs: release: uses: ./.github/workflows/release.yml # its job publish requests contents: write ``` ```yaml jobs: release: uses: ./.github/workflows/release.yml permissions: contents: write ``` ## Scope [#scope] What a call grants is the calling job's `permissions:`, else its workflow's. With neither, it gets the repository's or organization's default, which flowpact cannot see, so the call is not checked; when the calling workflow is itself called, the workflows it calls are checked against what its callers grant instead. What a called job requests is its `permissions:`, else its workflow's (reported once for every job that uses them); a job with neither gets what the call grants. A called job that calls another workflow requests its permissions for all of it, and the jobs of that workflow are checked against them at that call. Jobs are checked whatever their `if:`, as GitHub checks them before any job starts. A remote reusable workflow is checked against what the remote interfaces lockfile records: its jobs' `permissions:`, and its own for the jobs that have none (an entry written before flowpact recorded them has neither until `flowpact remotes update`). A job of it that calls another workflow without permissions is not followed. Whether a job requests more than it needs is not checked. ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP613] why`): ```yaml title=".github/workflows/release.yml" # flowpact: ignore[FP613] why it is acceptable here permissions: ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP613 target: ".github/workflows/release.yml#jobs.publish.permissions" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP613") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP613: off # or: ungranted-permissions: error ``` Explain it in the terminal: ```sh flowpact explain FP613 ``` ## Related [#related] - [`FP609`](https://ciatlas.github.io/flowpact/docs/rules/fp609) callee-not-reusable: A job calls a local workflow that has no `on.workflow_call` trigger. - [`FP503`](https://ciatlas.github.io/flowpact/docs/rules/fp503) schema-violation: The file does not match GitHub’s workflow / action schema (validated with GitHub’s own parser). - [Remote interfaces](https://ciatlas.github.io/flowpact/docs/remote-interfaces) # FP614 · actions-lock-unreadable (https://ciatlas.github.io/flowpact/docs/rules/fp614) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP614` | `actions-lock-unreadable` | Graph structure | 🟡 warning | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] flowpact reads a remote action at the commit `actions.lock` pins, which is the one GitHub runs. Without the file, each action is read where its ref points now, which can be another commit with other inputs, and [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) no longer compares the remote interfaces lockfile with it. GitHub still runs the pinned commits. ## How to fix [#how-to-fix] For a schema version flowpact does not read yet (it reads `v0.0.x`), upgrade flowpact. For a file that does not parse, write it again with `gh actions-lock`. ## Example [#example] ```yaml # .github/workflows/actions.lock, from a gh actions-lock newer than flowpact version: 'v0.1.0' workflows: '.github/workflows/ci.yml': - 'octo/setup@v2' ``` ```yaml # a version flowpact reads version: 'v0.0.3' workflows: '.github/workflows/ci.yml': - 'octo/setup@v2' ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP614 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP614") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP614: off # or: actions-lock-unreadable: error ``` Explain it in the terminal: ```sh flowpact explain FP614 ``` ## Related [#related] - [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) remotes-lock-outdated: The remote interfaces lockfile lacks a remote workflow or action the repository uses, has one it no longer uses, or records another commit than the one a reference pins or GitHub’s actions.lock runs. - [`FP611`](https://ciatlas.github.io/flowpact/docs/rules/fp611) remotes-lock-invalid: The remote interfaces lockfile does not parse, or does not match its schema. - [GitHub’s actions.lock](https://ciatlas.github.io/flowpact/docs/remote-interfaces#githubs-actionslock) # FP801 · contract-missing (https://ciatlas.github.io/flowpact/docs/rules/fp801) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP801` | `contract-missing` | Contracts | 🔴 error | `check`, the action's `mode: check`, the editor with contracts | ## What you see [#what-you-see] In the [`boolean-values`](https://github.com/ciatlas/flowpact/tree/main/fixtures/boolean-values) fixture: ```text ✖ ERROR FP801 contract-missing .github/actions/notify has no contract (expected .github/flowpact/contracts/actions/notify.contract.yaml) ▶ .github/actions/notify/action.yml:1:1 ``` ## Why it matters [#why-it-matters] Without a locked contract, changes to its interface and wiring are not visible in review and cannot be checked. ## How to fix [#how-to-fix] Run `flowpact generate` and commit the updated contracts. In CI, the flowpact action (check mode) attaches the regenerated contracts and a `git apply`-able patch to the run — see its job summary. ## Example [#example] ```yaml # .github/workflows/deploy.yml is new, and .github/flowpact/contracts/ has no contract for it on: workflow_call: inputs: environment: { type: string, required: true } ``` ```yaml # `flowpact generate` writes .github/flowpact/contracts/workflows/deploy.contract.yaml: commit it kind: workflow path: .github/workflows/deploy.yml interface: inputs: environment: type: string required: true ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP801 target: ".github/actions/notify" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP801") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP801: off # or: contract-missing: error ``` Explain it in the terminal: ```sh flowpact explain FP801 ``` ## Related [#related] - [`FP802`](https://ciatlas.github.io/flowpact/docs/rules/fp802) contract-outdated: The locked contract no longer matches the workflow — non-breaking changes to its interface or wiring. - [`FP804`](https://ciatlas.github.io/flowpact/docs/rules/fp804) orphan-contract: A contract file exists for a workflow or action that no longer exists. - [Contracts](https://ciatlas.github.io/flowpact/docs/contracts) # FP802 · contract-outdated (https://ciatlas.github.io/flowpact/docs/rules/fp802) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP802` | `contract-outdated` | Contracts | 🔴 error | `check`, the action's `mode: check`, the editor with contracts | ## What you see [#what-you-see] In the [`contracts-drift`](https://github.com/ciatlas/flowpact/tree/main/fixtures/contracts-drift) fixture: ```text ✖ ERROR FP802 contract-outdated Contract .github/flowpact/contracts/actions/notify.contract.yml is outdated: input "emoji" was added ▶ .github/actions/notify/action.yml:11:3 ``` ## Why it matters [#why-it-matters] The contract is the reviewed record of what flows in and out. When it drifts silently, the next reviewer compares against stale information. ## How to fix [#how-to-fix] Run `flowpact generate` and commit the updated contracts. In CI, the flowpact action (check mode) attaches the regenerated contracts and a `git apply`-able patch to the run — see its job summary. ## Example [#example] ```yaml # .github/actions/notify/action.yml gained an input that its contract does not list yet inputs: emoji: description: Emoji prefix for the message default: ':rocket:' ``` ```yaml # `flowpact generate` updates .github/flowpact/contracts/actions/notify.contract.yaml interface: inputs: emoji: required: false default: ':rocket:' description: Emoji prefix for the message ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP802 target: ".github/actions/notify" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP802") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP802: off # or: contract-outdated: error ``` Explain it in the terminal: ```sh flowpact explain FP802 ``` ## Related [#related] - [`FP801`](https://ciatlas.github.io/flowpact/docs/rules/fp801) contract-missing: A workflow or local action has no contract in `.github/flowpact/` (check mode). - [`FP803`](https://ciatlas.github.io/flowpact/docs/rules/fp803) breaking-interface-change: A change breaks the locked contract: an input became required, an input/secret/output was removed, or a type changed. - [Contracts](https://ciatlas.github.io/flowpact/docs/contracts) # FP803 · breaking-interface-change (https://ciatlas.github.io/flowpact/docs/rules/fp803) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP803` | `breaking-interface-change` | Contracts | 🔴 error | `check`, the action's `mode: check`, the editor with contracts | ## What you see [#what-you-see] In the [`contracts-drift`](https://github.com/ciatlas/flowpact/tree/main/fixtures/contracts-drift) fixture: ```text ✖ ERROR FP803 breaking-interface-change Breaking change to .github/workflows/deploy.yml: output "deployed-version" was removed — consumers reading it get an empty value ▶ .github/workflows/deploy.yml:3:3 ``` ## Why it matters [#why-it-matters] Callers written against the locked interface will fail (unknown or missing input) or silently read empty outputs. In large pipelines those callers may live in other repositories or rarely-run branches. ## How to fix [#how-to-fix] Update every caller first (flowpact lists the known consumers), then regenerate the contract. If the change is intended, `flowpact generate` records it and the diff makes the break explicit in review. ## Example [#example] ```yaml # contract: input "channel" optional on: workflow_call: inputs: channel: { type: string, required: true } # now required ``` ```yaml # keep it optional with a default (a required workflow_call input ignores its default), # or update all callers first, then: flowpact generate channel: { type: string, required: false, default: stable } ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and does not fail the build. **On its line**, with an [ignore comment](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) alone on the line above it (the editor's quick fix adds it there) or at the end of the line, after any other comment such as a version (`# v4.3.0 # flowpact: ignore[FP803] why`): ```yaml title=".github/workflows/deploy.yml" # flowpact: ignore[FP803] why it is acceptable here workflow_call: ``` **In the config**, with an [override](https://ciatlas.github.io/flowpact/docs/configuration#overrides), which can expire: ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP803 target: ".github/workflows/deploy.yml#outputs.deployed-version" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP803") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP803: off # or: breaking-interface-change: error ``` Explain it in the terminal: ```sh flowpact explain FP803 ``` ## Related [#related] - [`FP802`](https://ciatlas.github.io/flowpact/docs/rules/fp802) contract-outdated: The locked contract no longer matches the workflow — non-breaking changes to its interface or wiring. - [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) impact-under-declared: The changes to published workflows or actions need a bigger release than the pull request declares. - [Contracts](https://ciatlas.github.io/flowpact/docs/contracts) # FP804 · orphan-contract (https://ciatlas.github.io/flowpact/docs/rules/fp804) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP804` | `orphan-contract` | Contracts | 🔴 error | `check`, the action's `mode: check`, the editor with contracts | ## What you see [#what-you-see] In the [`contracts-drift`](https://github.com/ciatlas/flowpact/tree/main/fixtures/contracts-drift) fixture: ```text ✖ ERROR FP804 orphan-contract Contract .github/flowpact/contracts/workflows/nightly.contract.yml describes .github/workflows/nightly.yml which no longer exists ▶ .github/flowpact/contracts/workflows/nightly.contract.yml:1:1 ``` ## Why it matters [#why-it-matters] If the workflow was removed or renamed, anything still calling it (including other repositories) breaks — the stale contract is the last record of that interface. ## How to fix [#how-to-fix] Confirm nothing depends on the removed workflow, then run `flowpact generate` to delete the contract. ## Example [#example] ```yaml # .github/workflows/nightly.yml was deleted; its contract is still there # .github/flowpact/contracts/workflows/nightly.contract.yaml kind: workflow path: .github/workflows/nightly.yml ``` ```yaml # nothing calls nightly.yml any more: `flowpact generate` deletes its contract ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP804 target: ".github/workflows/nightly.yml" reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP804") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP804: off # or: orphan-contract: error ``` Explain it in the terminal: ```sh flowpact explain FP804 ``` ## Related [#related] - [`FP801`](https://ciatlas.github.io/flowpact/docs/rules/fp801) contract-missing: A workflow or local action has no contract in `.github/flowpact/` (check mode). - [Contracts](https://ciatlas.github.io/flowpact/docs/contracts) # FP805 · contract-invalid (https://ciatlas.github.io/flowpact/docs/rules/fp805) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP805` | `contract-invalid` | Contracts | 🔴 error | `check`, the action's `mode: check`, the editor with contracts | ## Why it matters [#why-it-matters] An unreadable contract cannot be compared, so drift and breaking changes go unnoticed. ## How to fix [#how-to-fix] Contracts are generated: resolve the merge by running `flowpact generate` instead of editing the file. ## Example [#example] ```yaml # .github/flowpact/contracts/workflows/deploy.contract.yaml after a merge interface: inputs: <<<<<<< HEAD environment: ======= env: >>>>>>> main ``` ```yaml # resolve the conflict in deploy.yml, then `flowpact generate` writes the contract again interface: inputs: environment: type: string required: true ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP805 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP805") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP805: off # or: contract-invalid: error ``` Explain it in the terminal: ```sh flowpact explain FP805 ``` ## Related [#related] - [`FP802`](https://ciatlas.github.io/flowpact/docs/rules/fp802) contract-outdated: The locked contract no longer matches the workflow — non-breaking changes to its interface or wiring. - [Contracts](https://ciatlas.github.io/flowpact/docs/contracts) # FP810 · impact-under-declared (https://ciatlas.github.io/flowpact/docs/rules/fp810) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP810` | `impact-under-declared` | Contracts | 🔴 error | [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) | ## Why it matters [#why-it-matters] Consumers pin a floating tag (`@v1`) or a version range and take every release in it, and read the version to judge an update. A change released at a lower level than it needs reaches them without warning: a breaking one released as a minor or patch leaves their required status check waiting forever or fails their run, and a new environment or check released as a patch changes their runs where they expected fixes only. ## How to fix [#how-to-fix] Declare the required impact (for example retitle the pull request `feat!: …` for a major release), or keep the published interface and check names compatible. ## Example [#example] ```yaml # PR title: "fix: tidy the test job" jobs: test: name: Unit tests # was "Test": consumers' required check "… / Test" never reports ``` ```yaml # PR title: "fix!: rename the test job's check to Unit tests" ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP810 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP810") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. An override counts only once it is on the base branch: impact mode reads the overrides and severities of its rules from the baseline's config, so a pull request cannot accept or switch off its own check. No ignore comment accepts its findings. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP810: off # or: impact-under-declared: error ``` A severity counts only once it is on the base branch, as impact mode reads it from the baseline's config. Explain it in the terminal: ```sh flowpact explain FP810 ``` ## Related [#related] - [`FP811`](https://ciatlas.github.io/flowpact/docs/rules/fp811) impact-declaration-conflict: Another source declares a bigger impact than the one the release tool reads. - [`FP812`](https://ciatlas.github.io/flowpact/docs/rules/fp812) impact-over-declared: The pull request declares a bigger impact than its workflow and action changes require. - [`FP813`](https://ciatlas.github.io/flowpact/docs/rules/fp813) impact-undeclared: No release impact is declared; flowpact reports the impact the changes require. - [`FP814`](https://ciatlas.github.io/flowpact/docs/rules/fp814) impact-uncertain: A change to a published unit depends on something flowpact cannot evaluate statically. - [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) # FP811 · impact-declaration-conflict (https://ciatlas.github.io/flowpact/docs/rules/fp811) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP811` | `impact-declaration-conflict` | Contracts | 🔴 error | [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) | ## Why it matters [#why-it-matters] Release tools read one thing — usually the squashed commit title. A `semver:major` label on a `fix:` pull request looks right in review, but the release is cut as a patch. ## How to fix [#how-to-fix] Make the authoritative source (`impact.declaredBy`, the title by default) declare the impact, for example `feat!: …`. ## Example [#example] ```yaml # PR title: "fix: rename the deploy output" (the release tool reads this: a patch) # PR label: semver:major ``` ```yaml # PR title: "fix!: rename the deploy output" ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP811 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP811") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. An override counts only once it is on the base branch: impact mode reads the overrides and severities of its rules from the baseline's config, so a pull request cannot accept or switch off its own check. No ignore comment accepts its findings. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP811: off # or: impact-declaration-conflict: error ``` A severity counts only once it is on the base branch, as impact mode reads it from the baseline's config. Explain it in the terminal: ```sh flowpact explain FP811 ``` ## Related [#related] - [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) impact-under-declared: The changes to published workflows or actions need a bigger release than the pull request declares. - [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) # FP812 · impact-over-declared (https://ciatlas.github.io/flowpact/docs/rules/fp812) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP812` | `impact-over-declared` | Contracts | 🔵 info | [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) | ## Why it matters [#why-it-matters] Not a problem: the release may contain changes flowpact does not grade. Reported so the declaration is visible. ## How to fix [#how-to-fix] Nothing to fix if the release has other changes; otherwise declare the smaller impact. ## Example [#example] ```yaml # PR title: "feat!: tidy the deploy workflow" (declares major) # the only change to a published workflow is a step's command: a patch ``` ```yaml # PR title: "fix: tidy the deploy workflow" ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP812 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP812") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. An override counts only once it is on the base branch: impact mode reads the overrides and severities of its rules from the baseline's config, so a pull request cannot accept or switch off its own check. No ignore comment accepts its findings. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP812: off # or: impact-over-declared: error ``` A severity counts only once it is on the base branch, as impact mode reads it from the baseline's config. Explain it in the terminal: ```sh flowpact explain FP812 ``` ## Related [#related] - [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) impact-under-declared: The changes to published workflows or actions need a bigger release than the pull request declares. - [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) # FP813 · impact-undeclared (https://ciatlas.github.io/flowpact/docs/rules/fp813) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP813` | `impact-undeclared` | Contracts | 🔵 info | [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) | ## Why it matters [#why-it-matters] Without a declaration there is nothing to check against. The required impact is still useful when cutting a release. ## How to fix [#how-to-fix] Declare the impact: a Conventional Commits pull request title (`feat: …`, `fix!: …`), a `semver:*` label, or `--expect`. ## Example [#example] ```yaml # PR title: "Update the deploy workflow" (no Conventional Commits type: nothing declared) ``` ```yaml # PR title: "fix: update the deploy workflow" ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP813 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP813") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. An override counts only once it is on the base branch: impact mode reads the overrides and severities of its rules from the baseline's config, so a pull request cannot accept or switch off its own check. No ignore comment accepts its findings. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP813: off # or: impact-undeclared: error ``` A severity counts only once it is on the base branch, as impact mode reads it from the baseline's config. Explain it in the terminal: ```sh flowpact explain FP813 ``` ## Related [#related] - [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) impact-under-declared: The changes to published workflows or actions need a bigger release than the pull request declares. - [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) # FP814 · impact-uncertain (https://ciatlas.github.io/flowpact/docs/rules/fp814) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP814` | `impact-uncertain` | Contracts | 🟡 warning | [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) | ## Why it matters [#why-it-matters] For example a check name built from the triggering event, `needs` outputs or `vars`, a matrix computed at runtime, or an output that is now set only when an `if:` holds. flowpact cannot tell whether consumers see a different check name, or run where the output is `''`, so it does not count the change (`impact.uncertain: fail` counts it). ## How to fix [#how-to-fix] Review the change by hand. Make a check name static (a literal `name:` or one built only from `matrix` and `inputs`); give an output a value on every run (no `if:` on its source, or a fallback such as `${{ steps.m.outputs.v || 'none' }}`), or declare the change as major. ## Example [#example] ```yaml # in a published reusable workflow jobs: test: runs-on: ${{ inputs.runner }} # was ubuntu-latest: which runners callers need is known only at run time ``` ```yaml jobs: test: runs-on: ubuntu-latest # or keep the change, and declare it major (feat!: …) ``` ## Accept one finding [#accept-one-finding] When a finding is intended, accept it with a reason rather than turning the rule off. It is listed apart from the other findings, and comes back when the date passes ([overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides)): ```yaml title=".github/flowpact/flowpact.config.yml" overrides: - rule: FP814 target: reason: Why it is acceptable here, at least 10 characters. expires: YYYY-MM-DD # optional ``` `target` is the symbol the finding is about; to list them: ```sh flowpact lint --format json | jq -r '.findings[] | select(.code == "FP814") | .symbol' ``` `*` matches within a path segment and `**` across segments, so one entry accepts every finding whose symbol matches: `target: '**#inputs.app-id'` is that input in every workflow and action. An override counts only once it is on the base branch: impact mode reads the overrides and severities of its rules from the baseline's config, so a pull request cannot accept or switch off its own check. No ignore comment accepts its findings. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP814: off # or: impact-uncertain: error ``` A severity counts only once it is on the base branch, as impact mode reads it from the baseline's config. Explain it in the terminal: ```sh flowpact explain FP814 ``` ## Related [#related] - [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) impact-under-declared: The changes to published workflows or actions need a bigger release than the pull request declares. - [Impact mode](https://ciatlas.github.io/flowpact/docs/impact-mode) # FP901 · override-expired (https://ciatlas.github.io/flowpact/docs/rules/fp901) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP901` | `override-expired` | Config & overrides | 🔴 error | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] Overrides are meant to be temporary exceptions with an owner. An expired one means the follow-up work was not done and the original problem is back in scope. ## How to fix [#how-to-fix] Fix the underlying findings and delete the override, or — if the exception is still justified — extend `expires` with an updated reason. ## Example [#example] ```yaml overrides: - rule: unused-input target: .github/workflows/pipeline.yml#inputs.legacy-flag reason: Read by the release dispatcher until the migration (JIRA-123) expires: 2026-01-31 ``` ```yaml # migration done: input removed, override deleted ``` ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP901: off # or: override-expired: error ``` Explain it in the terminal: ```sh flowpact explain FP901 ``` ## Related [#related] - [`FP902`](https://ciatlas.github.io/flowpact/docs/rules/fp902) override-unused: An override matches no finding — the problem was fixed, or the target is misspelled. - [`FP903`](https://ciatlas.github.io/flowpact/docs/rules/fp903) override-expiring-soon: An override expires within 14 days. - [Overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides) # FP902 · override-unused (https://ciatlas.github.io/flowpact/docs/rules/fp902) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP902` | `override-unused` | Config & overrides | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`contracts-drift`](https://github.com/ciatlas/flowpact/tree/main/fixtures/contracts-drift) fixture: ```text ▲ WARN FP902 override-unused Override for unused-output on .github/workflows/deploy.yml#outputs.url matches no finding ▶ .github/flowpact/flowpact.config.yml:13:5 ``` ## Why it matters [#why-it-matters] Stale overrides hide future problems at the same target and make the exception list untrustworthy. ## How to fix [#how-to-fix] Delete the override, or correct its `rule` / `target` / `file` (use the `symbol` shown in JSON output or `flowpact lint --format json`). ## Example [#example] ```yaml overrides: - rule: unused-input target: .github/workflows/deploy.yml#inputs.siute # misspelled: matches no finding reason: Read by the release dispatcher until the migration ``` ```yaml overrides: - rule: unused-input target: .github/workflows/deploy.yml#inputs.suite reason: Read by the release dispatcher until the migration ``` ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP902: off # or: override-unused: error ``` Explain it in the terminal: ```sh flowpact explain FP902 ``` ## Related [#related] - [`FP901`](https://ciatlas.github.io/flowpact/docs/rules/fp901) override-expired: An override passed its `expires` date; the findings it suppressed are reported again. - [`FP905`](https://ciatlas.github.io/flowpact/docs/rules/fp905) ignore-comment-unused: A `# flowpact: ignore[…]` comment names a rule that reports nothing on the line it accepts. - [Overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides) # FP903 · override-expiring-soon (https://ciatlas.github.io/flowpact/docs/rules/fp903) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP903` | `override-expiring-soon` | Config & overrides | 🔵 info | `lint`, `check`, the action, the editor | ## Why it matters [#why-it-matters] A heads-up so the owner can finish the follow-up before the build starts failing. ## How to fix [#how-to-fix] Fix the underlying findings, or extend `expires` with an updated reason. ## Example [#example] ```yaml overrides: - rule: unused-input target: .github/workflows/pipeline.yml#inputs.legacy-flag reason: Read by the release dispatcher until the migration (JIRA-123) expires: 2026-01-31 # within 14 days ``` ```yaml # migration done: the input and the override deleted; or, when it slipped, a new date and why reason: The release dispatcher reads it until the migration moves to Q2 (JIRA-123) expires: 2026-04-30 ``` ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP903: off # or: override-expiring-soon: error ``` Explain it in the terminal: ```sh flowpact explain FP903 ``` ## Related [#related] - [`FP901`](https://ciatlas.github.io/flowpact/docs/rules/fp901) override-expired: An override passed its `expires` date; the findings it suppressed are reported again. - [Overrides](https://ciatlas.github.io/flowpact/docs/configuration#overrides) # FP904 · ignore-comment-invalid (https://ciatlas.github.io/flowpact/docs/rules/fp904) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP904` | `ignore-comment-invalid` | Config & overrides | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`ignore-comments`](https://github.com/ciatlas/flowpact/tree/main/fixtures/ignore-comments) fixture: ```text ▲ WARN FP904 ignore-comment-invalid Ignore comment names an unknown rule "FP5O1" (did you mean FP501?) ▶ .github/workflows/release.yml:21:74 ``` ## Why it matters [#why-it-matters] Such a comment accepts nothing: the finding it was written for is still reported, and the comment hides why. ## How to fix [#how-to-fix] Correct the rule: its code or its name, as `flowpact rules` lists them, in brackets after `# flowpact: ignore`. The rules about overrides and ignore comments (FP9xx) check them once they are applied, so no comment can ignore them. Impact mode's rules (FP810–FP814) grade the pull request itself: only an override in the baseline's config accepts them. ## Example [#example] ```yaml notify: uses: acme/shared/.github/workflows/notify.yml@0123456789abcdef0123456789abcdef01234567 # v1.2.0 # flowpact: ignore[remote-unverifed] checked in acme/shared ``` ```yaml notify: uses: acme/shared/.github/workflows/notify.yml@0123456789abcdef0123456789abcdef01234567 # v1.2.0 # flowpact: ignore[remote-unverified] checked in acme/shared ``` ## Scope [#scope] Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP904: off # or: ignore-comment-invalid: error ``` Explain it in the terminal: ```sh flowpact explain FP904 ``` ## Related [#related] - [`FP905`](https://ciatlas.github.io/flowpact/docs/rules/fp905) ignore-comment-unused: A `# flowpact: ignore[…]` comment names a rule that reports nothing on the line it accepts. - [Ignore comments](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) # FP905 · ignore-comment-unused (https://ciatlas.github.io/flowpact/docs/rules/fp905) {/* Generated by scripts/gen-rule-docs.ts from packages/lint/src/rules — edit the rule, not this file. */} | Code | Name | Category | Default severity | Reported by | | --- | --- | --- | --- | --- | | `FP905` | `ignore-comment-unused` | Config & overrides | 🟡 warning | `lint`, `check`, the action, the editor | ## What you see [#what-you-see] In the [`ignore-comments`](https://github.com/ciatlas/flowpact/tree/main/fixtures/ignore-comments) fixture: ```text ▲ WARN FP905 ignore-comment-unused Ignore comment for FP108 matches no finding on line 22 ▶ .github/workflows/release.yml:22:74 ``` ## Why it matters [#why-it-matters] The problem was fixed, or the comment is on another line than the finding. Either way it would hide a later finding of that rule there that nobody looked at. ## How to fix [#how-to-fix] Delete the rule from the comment, or the comment when it names no other. A comment accepts the findings reported on its line; alone on its line, those on the next line of YAML; on a block scalar’s line (`run: |`), those in its text. ## Example [#example] ```yaml # the workflow declares inputs.target now, so FP108 reports nothing on the next line - run: echo "${{ inputs.target }}" # flowpact: ignore[FP108] ``` ```yaml - run: echo "${{ inputs.target }}" ``` ## Scope [#scope] Not reported in [generated files](https://ciatlas.github.io/flowpact/docs/configuration#generated-files), which are not edited by hand. ## Change the severity [#change-the-severity] Change the severity (or turn the rule off) in `.github/flowpact/flowpact.config.yml`, by code or by name: ```yaml title=".github/flowpact/flowpact.config.yml" rules: FP905: off # or: ignore-comment-unused: error ``` Explain it in the terminal: ```sh flowpact explain FP905 ``` ## Related [#related] - [`FP904`](https://ciatlas.github.io/flowpact/docs/rules/fp904) ignore-comment-invalid: A `# flowpact: ignore[…]` comment names an unknown rule or one no comment can ignore, or is not written as `ignore[]`. - [`FP902`](https://ciatlas.github.io/flowpact/docs/rules/fp902) override-unused: An override matches no finding — the problem was fixed, or the target is misspelled. - [Ignore comments](https://ciatlas.github.io/flowpact/docs/configuration#ignore-comments) # Rules (https://ciatlas.github.io/flowpact/docs/rules) {/* Generated by scripts/gen-rule-docs.ts — edit the rules, not this file. */} Codes have the form `` — built-in rules use `FP`, so `FP4xx` are matrix rules. Severity is configurable per rule; codes never change meaning. Plugin rules use their own prefix (for example `ACME101`). ## Inputs (`FP1xx`) [#inputs-fp1xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP101`](https://ciatlas.github.io/flowpact/docs/rules/fp101) | `missing-required-input` | 🔴 error | A reusable workflow or local action is called without one of its required inputs. | | [`FP102`](https://ciatlas.github.io/flowpact/docs/rules/fp102) | `unknown-input` | 🔴 error | A caller passes an input the reusable workflow or local action does not declare. | | [`FP103`](https://ciatlas.github.io/flowpact/docs/rules/fp103) | `input-type-mismatch` | 🔴 error | A literal value passed to a typed `workflow_call` input has the wrong type. | | [`FP104`](https://ciatlas.github.io/flowpact/docs/rules/fp104) | `unused-input` | 🟡 warning | An input is declared but never read anywhere in the workflow or action. | | [`FP105`](https://ciatlas.github.io/flowpact/docs/rules/fp105) | `optional-input-no-default-in-condition` | 🟡 warning | An optional input that is '' when omitted (no default, or `default: ''`) decides an `if:` by its truthiness. | | [`FP106`](https://ciatlas.github.io/flowpact/docs/rules/fp106) | `passthrough-dropped` | 🔵 info | A caller passes a value to an input that the callee declares but never reads. | | [`FP107`](https://ciatlas.github.io/flowpact/docs/rules/fp107) | `optional-forwarded-to-required` | 🟡 warning | A required input of a callee is fed from an optional input that is '' when omitted (no default, or `default: ''`). | | [`FP108`](https://ciatlas.github.io/flowpact/docs/rules/fp108) | `undefined-input-ref` | 🔴 error | An expression reads `inputs.` that the workflow or action does not declare. | ## Secrets (`FP2xx`) [#secrets-fp2xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP201`](https://ciatlas.github.io/flowpact/docs/rules/fp201) | `missing-required-secret` | 🔴 error | A reusable workflow is called without one of its required secrets. | | [`FP202`](https://ciatlas.github.io/flowpact/docs/rules/fp202) | `unknown-secret` | 🔴 error | A caller passes a secret the reusable workflow does not declare. | | [`FP203`](https://ciatlas.github.io/flowpact/docs/rules/fp203) | `unused-secret` | 🟡 warning | A `workflow_call` secret is declared but never read. | | [`FP204`](https://ciatlas.github.io/flowpact/docs/rules/fp204) | `secrets-inherit` | 🔵 info | `secrets: inherit` hands every repository secret to the callee; flowpact lists what is actually needed. | | [`FP205`](https://ciatlas.github.io/flowpact/docs/rules/fp205) | `undeclared-secret-ref` | 🔴 error | A reusable workflow reads a secret it does not declare, and some caller does not use `secrets: inherit`. | ## Outputs (`FP3xx`) [#outputs-fp3xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP301`](https://ciatlas.github.io/flowpact/docs/rules/fp301) | `undefined-output-ref` | 🔴 error | An expression reads an output (`needs.*`, `jobs.*`, `steps.*`) that is never defined. | | [`FP302`](https://ciatlas.github.io/flowpact/docs/rules/fp302) | `output-ref-without-needs` | 🔴 error | `needs.` is read where the `needs` context does not contain ``. | | [`FP303`](https://ciatlas.github.io/flowpact/docs/rules/fp303) | `unused-output` | 🟡 warning | A job output, or an output of an internal reusable workflow or action, is declared but nothing reads it. | | [`FP304`](https://ciatlas.github.io/flowpact/docs/rules/fp304) | `step-output-never-written` | 🟡 warning | An output is read from a step whose inline script (`run:` or `actions/github-script`) writes other outputs, but never this one. | ## Matrix (`FP4xx`) [#matrix-fp4xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP401`](https://ciatlas.github.io/flowpact/docs/rules/fp401) | `empty-binding-for-matrix-combo` | 🔴 error | An input passed under `with:` is empty for some matrix combinations because a matrix key is missing there. | | [`FP402`](https://ciatlas.github.io/flowpact/docs/rules/fp402) | `matrix-key-missing-in-combo` | 🟡 warning | An expression reads a matrix key that is only defined in some combinations. | | [`FP403`](https://ciatlas.github.io/flowpact/docs/rules/fp403) | `dynamic-matrix-unverified` | 🔵 info | The matrix is computed at runtime, so flowpact cannot check that every combination defines the keys it reads. | | [`FP404`](https://ciatlas.github.io/flowpact/docs/rules/fp404) | `undefined-matrix-key` | 🔴 error | An expression reads a matrix key that no combination defines (or the job has no matrix). | | [`FP405`](https://ciatlas.github.io/flowpact/docs/rules/fp405) | `unused-matrix-shape` | 🟡 warning | A `matrixShapes` entry in the config does not match a job with a runtime-computed matrix. | | [`FP406`](https://ciatlas.github.io/flowpact/docs/rules/fp406) | `matrix-too-large` | 🔴 error | A job's matrix produces more than 256 jobs, which GitHub rejects. | ## Env & expressions (`FP5xx`) [#env--expressions-fp5xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP501`](https://ciatlas.github.io/flowpact/docs/rules/fp501) | `undefined-env-ref` | 🟡 warning | `${{ env.NAME }}` reads a variable that is not defined at workflow, job or step level, nor written to `$GITHUB_ENV` earlier. | | [`FP502`](https://ciatlas.github.io/flowpact/docs/rules/fp502) | `expression-parse-error` | 🔴 error | A `${{ }}` expression (or an `if:` condition) cannot be parsed. | | [`FP503`](https://ciatlas.github.io/flowpact/docs/rules/fp503) | `schema-violation` | 🔴 error | The file does not match GitHub’s workflow / action schema (validated with GitHub’s own parser). | | [`FP504`](https://ciatlas.github.io/flowpact/docs/rules/fp504) | `yaml-syntax-error` | 🔴 error | The file is not valid YAML. | | [`FP505`](https://ciatlas.github.io/flowpact/docs/rules/fp505) | `context-not-available` | 🔴 error | An expression uses a context or function that GitHub does not allow in that field (e.g. `env` in a reusable workflow call’s `with:`). | | [`FP506`](https://ciatlas.github.io/flowpact/docs/rules/fp506) | `value-not-boolean` | 🔴 error | A value read as a boolean can be another string: `fromJSON()` of a value that may be '', a comparison with 'true' of a value that may be other text, or an `env:`, `with:` or `outputs:` value that gives a boolean or text. | | [`FP507`](https://ciatlas.github.io/flowpact/docs/rules/fp507) | `redundant-empty-comparison` | ⚪ off (opt-in) | A condition compares a value with `''` (`!= ''`, `== ''`), which `if:` already does by itself. | ## Graph structure (`FP6xx`) [#graph-structure-fp6xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP601`](https://ciatlas.github.io/flowpact/docs/rules/fp601) | `call-cycle` | 🔴 error | Reusable workflows call each other in a cycle. | | [`FP602`](https://ciatlas.github.io/flowpact/docs/rules/fp602) | `nesting-depth` | 🔴 error | A chain of reusable workflow calls is deeper than the configured limit (`limits.nestingDepth`). | | [`FP603`](https://ciatlas.github.io/flowpact/docs/rules/fp603) | `remote-unverified` | 🔵 info | A job calls a reusable workflow in another repository whose interface is not in the remote interfaces lockfile. | | [`FP604`](https://ciatlas.github.io/flowpact/docs/rules/fp604) | `needs-without-data` | ⚪ off (opt-in) | A job lists another job under `needs:` but never reads its outputs or result (opt-in). | | [`FP605`](https://ciatlas.github.io/flowpact/docs/rules/fp605) | `large-interface` | 🔵 info | A reusable workflow declares more inputs than `limits.maxInputs`. | | [`FP606`](https://ciatlas.github.io/flowpact/docs/rules/fp606) | `missing-local-target` | 🔴 error | A local `uses: ./...` or `uses: $/...` points to a workflow or action that does not exist where GitHub looks for it, or is written in a form GitHub rejects. | | [`FP607`](https://ciatlas.github.io/flowpact/docs/rules/fp607) | `unreferenced-reusable-workflow` | 🔵 info | A workflow can only be triggered by `workflow_call`, but nothing in this repository calls it. | | [`FP608`](https://ciatlas.github.io/flowpact/docs/rules/fp608) | `undefined-needs-job` | 🔴 error | A job lists a job under `needs:` that does not exist. | | [`FP609`](https://ciatlas.github.io/flowpact/docs/rules/fp609) | `callee-not-reusable` | 🔴 error | A job calls a local workflow that has no `on.workflow_call` trigger. | | [`FP610`](https://ciatlas.github.io/flowpact/docs/rules/fp610) | `workspace-unverified` | 🔵 info | A step’s `uses: ./...` points to a place in the runner’s workspace that flowpact cannot read, so the action is not verified. | | [`FP611`](https://ciatlas.github.io/flowpact/docs/rules/fp611) | `remotes-lock-invalid` | 🔴 error | The remote interfaces lockfile does not parse, or does not match its schema. | | [`FP612`](https://ciatlas.github.io/flowpact/docs/rules/fp612) | `remotes-lock-outdated` | 🟡 warning | The remote interfaces lockfile lacks a remote workflow or action the repository uses, has one it no longer uses, or records another commit than the one a reference pins or GitHub’s actions.lock runs. | | [`FP613`](https://ciatlas.github.io/flowpact/docs/rules/fp613) | `ungranted-permissions` | 🔴 error | A job of a called workflow requests a permission the call does not grant. | | [`FP614`](https://ciatlas.github.io/flowpact/docs/rules/fp614) | `actions-lock-unreadable` | 🟡 warning | GitHub’s `.github/workflows/actions.lock` does not parse, or has a schema version flowpact does not read. | ## Contracts (`FP80x`) [#contracts-fp80x] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP801`](https://ciatlas.github.io/flowpact/docs/rules/fp801) | `contract-missing` | 🔴 error | A workflow or local action has no contract in `.github/flowpact/` (check mode). | | [`FP802`](https://ciatlas.github.io/flowpact/docs/rules/fp802) | `contract-outdated` | 🔴 error | The locked contract no longer matches the workflow — non-breaking changes to its interface or wiring. | | [`FP803`](https://ciatlas.github.io/flowpact/docs/rules/fp803) | `breaking-interface-change` | 🔴 error | A change breaks the locked contract: an input became required, an input/secret/output was removed, or a type changed. | | [`FP804`](https://ciatlas.github.io/flowpact/docs/rules/fp804) | `orphan-contract` | 🔴 error | A contract file exists for a workflow or action that no longer exists. | | [`FP805`](https://ciatlas.github.io/flowpact/docs/rules/fp805) | `contract-invalid` | 🔴 error | A contract file cannot be read (invalid YAML or schema), usually because it was edited by hand or merged badly. | ## Impact mode (`FP81x`) [#impact-mode-fp81x] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP810`](https://ciatlas.github.io/flowpact/docs/rules/fp810) | `impact-under-declared` | 🔴 error | The changes to published workflows or actions need a bigger release than the pull request declares. | | [`FP811`](https://ciatlas.github.io/flowpact/docs/rules/fp811) | `impact-declaration-conflict` | 🔴 error | Another source declares a bigger impact than the one the release tool reads. | | [`FP812`](https://ciatlas.github.io/flowpact/docs/rules/fp812) | `impact-over-declared` | 🔵 info | The pull request declares a bigger impact than its workflow and action changes require. | | [`FP813`](https://ciatlas.github.io/flowpact/docs/rules/fp813) | `impact-undeclared` | 🔵 info | No release impact is declared; flowpact reports the impact the changes require. | | [`FP814`](https://ciatlas.github.io/flowpact/docs/rules/fp814) | `impact-uncertain` | 🟡 warning | A change to a published unit depends on something flowpact cannot evaluate statically. | ## Config & overrides (`FP9xx`) [#config--overrides-fp9xx] | Code | Name | Default | Summary | | --- | --- | --- | --- | | [`FP901`](https://ciatlas.github.io/flowpact/docs/rules/fp901) | `override-expired` | 🔴 error | An override passed its `expires` date; the findings it suppressed are reported again. | | [`FP902`](https://ciatlas.github.io/flowpact/docs/rules/fp902) | `override-unused` | 🟡 warning | An override matches no finding — the problem was fixed, or the target is misspelled. | | [`FP903`](https://ciatlas.github.io/flowpact/docs/rules/fp903) | `override-expiring-soon` | 🔵 info | An override expires within 14 days. | | [`FP904`](https://ciatlas.github.io/flowpact/docs/rules/fp904) | `ignore-comment-invalid` | 🟡 warning | A `# flowpact: ignore[…]` comment names an unknown rule or one no comment can ignore, or is not written as `ignore[]`. | | [`FP905`](https://ciatlas.github.io/flowpact/docs/rules/fp905) | `ignore-comment-unused` | 🟡 warning | A `# flowpact: ignore[…]` comment names a rule that reports nothing on the line it accepts. | ## Reserved ranges [#reserved-ranges] - `FP7xx`: hygiene rules (none yet).