Skip to Content
flowpact

Follow a value

Where an input, secret or output goes and where it comes from, across reusable workflows and actions, on the command line and in the editor.

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.

Where does this value go?

npx 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 }}

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?

--up follows a value back to where it starts. In the incident-matrix fixture, a test suite's config input comes from a matrix:

npx flowpact trace run-suite.yml:config --up
.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:

$ 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; 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 lists them all, with inputs' defaults, dispatch inputs and toJSON(inputs).

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:

$ 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 reports expressions expanded into scripts (template injection); pass them through env: instead.

Name a value

QueryMatches
ci.yml:envthe inputs, secrets or outputs named env
ci.ymlthe whole interface of the workflow: every input, secret and output
ci.yml#inputs.envthat input, by file name
.github/workflows/ci.yml#inputs.envthat input, by path
setup:tokenan 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

The editor extension 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.

VS Code peek definition on the config key tests.yml passes to run-suite.yml: the input it lands on, and the if: that reads it
Go to definition from the key tests.yml passes: the input in run-suite.yml, and the if: that skips the tests when it is empty.

Which workflows call which

npx flowpact graph
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:

dot and json are for other tools (flowpact graph).

In scripts

--format json prints the traces for tools, and the API has trace() and graph() for programs.

How values are followed

On this page