https://github.com/push-based/user-flow-gh-action
📦 GH action for push-based/user-flow
https://github.com/push-based/user-flow-gh-action
Last synced: about 2 months ago
JSON representation
📦 GH action for push-based/user-flow
- Host: GitHub
- URL: https://github.com/push-based/user-flow-gh-action
- Owner: push-based
- License: mit
- Created: 2022-11-03T01:46:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-06T14:51:22.000Z (over 1 year ago)
- Last Synced: 2025-03-29T06:04:51.399Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 17.3 MB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chrome Lighthouse user flows as GitHub action
This repository maintains a GitHub action to run [@push-based/user-flow](https://github.com/push-based/user-flow) in a workflow.
It automatically detects flows, executes them and produces md reports as comments in your PR.
**Inputs:**
| Name | Type | Default | Description |
|------------------------------| --------- | --------------------------- |----------------------------------------------------------------------------------------------------------- |
| **`--commentId`** | `string` | `user flow summary report` | Id used to identify a comment in the PR (useful if multiple actions run user-flow for the same PR) |
| **`--commentsOnly`** | `string` | `off` | Only collects results and creates a comment in the PR (helpful if the reports are generated over external logic) |
| **`--rcPath`** | `string` | `./user-flowrc.json` | Path to `.user-flowrc.json`. e.g. `./user-flowrc.server.json` |
| **`--verbose`** | `string` | `off` | Run with verbose logging (only 'on' and 'off' is possible) |
| **`--dryRun`** | `string` | `off` | Run in `dryRun` mode (only 'on' and 'off' is possible) |
| **`...`** | ... | ... | All other actions from the user-flow CLI are available |# Setup
1. Create a file called `user-flow-ci.yml` in `./.github/workflows`.
This can be done by using the `init`:
`npx @push-based/user-flow init --generateGhWorkflow`2. The generated `user-flow-ci.yml` file should have the following content:
```yml
name: user-flow-ci
on:
pull_request:
jobs:
user-flow-integrated-in-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Executing user-flow CLI
# without any parameters the rcPath defaults to `.user-flowrc.json`
uses: push-based/[email protected]
```You can use action inputs over the with property:
```yml
name: user-flow-ci
on:
pull_request:
jobs:
user-flow-integrated-in-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Executing user-flow CLI
# without any parameters the rcPath defaults to `.user-flowrc.json`
uses: push-based/[email protected]
with:
commentId: test-e2e-first-run
dryRun: off
verbose: on
url: https://google.com
ufPath: ./user-flows
outPath: ./packages/user-flow-gh-action-e2e/measures
format: html,json
rcPath: ./.user-flowrc.json
```# How to test the setup
1. If you open a new PR in your repository you should see the runner execution your user-flow in the CI
![]()
2. After the user flow executed you should see a mark down report as comment attached to your PR
# How to use it with the nx-plugin and --affected
If you use Nx as you tooling choice you should consider our [Nx plugin](https://github.com/push-based/user-flow/tree/main/packages/nx-plugin) for [user-flow](https://github.com/push-based/user-flow).
Here is how you can combine it with the GitHub action:
1. Use the action with commentsOnly. besides the outPath no other params are considered.
```yml
name: user-flow-ci
on:
pull_request:
jobs:
user-flow-integrated-in-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Executing user-flow CLI
uses: push-based/[email protected]
with:
verbose: on
commentId: test-e2e-first-run
commentsOnly: on
```---
made with ❤ by [push-based.io](https://www.push-based.io)