DEV Community

Jacqueline Osborn
Jacqueline Osborn

Posted on

See your flow coverage changes on every PR!

Recently, I was going through a repo I contribute to in order to convert files to use Flow type checking, when I had the idea to create a GitHub action to comment on PRs the difference in flow coverage on the files touched by the PR. I would love if this was useful to someone, and I appreciate any and all feedback!

Top comments (1)

Collapse
 
ben profile image
Ben Halpern

Preview:

GitHub logo jackieo5023 / flow-coverage-compare

Github action to compare flow coverage on a PR to the base branch.

Flow Coverage Compare

Github action to compare flow coverage on a PR to the base branch.

Running this action will create a comment like this on your pull request Example of action

Usage

You'll want to add this job to one of your workflow files. Below are examples of sample workflow files using this action. Additionally, in order to use this action, you'll want to ensure you can run flow like yarn run flow or npm run flow in your repository.

Action inputs

The possible inputs for this action are:

Parameter Description Default
github-token The GitHub authentication token GITHUB_TOKEN
package-manager The package manager your repo uses - either yarn or npm yarn
path The path to your .flowconfig (which should be the same as the path to your package.json)
pattern The regex pattern used to determine which files to run flow on ^.*.js$
threshold The number of percentage points down where
…