Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add output input for customizing reports directory #99

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ The action may be customized using the following optional inputs:
| `artifacts` | Toggles if artifacts will we uploaded/downloaded | `true` |
| `retention` | Artifact retention period in days | from repository settings |
| `directory` | Directory in which `code-pushup` should run | `process.cwd()` |
| `output` | Directory where reports will be created | `.code-pushup` |
| `config` | Path to config file (`--config` option) | see [`@code-pushup/cli` docs](https://github.com/code-pushup/cli/tree/main/packages/cli#configuration) |
| `silent` | Toggles if logs from Code PushUp CLI are printed | `false` |
| `bin` | Command for executing Code PushUp CLI | `npx --no-install code-pushup` |
Expand Down Expand Up @@ -150,3 +151,14 @@ can override the name using the optional `task` input:
monorepo: nx
task: analyze # custom Nx target
```

For caching purposes, you may prefer to separate output directories per project.
The `output` input supports interpolating the project name in the path using
`{project}` syntax:

```yml
- uses: code-pushup/github-action@v0
with:
monorepo: true
output: .code-pushup/{project}
```
3 changes: 2 additions & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { run } from '../src/main'

describe('code-pushup action', () => {
const workDir = join('tmp', 'git-repo')
const workDir = join(process.cwd(), 'tmp', 'git-repo')

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const getOctokit = () =>
Expand Down Expand Up @@ -65,6 +65,7 @@ describe('code-pushup action', () => {
process.env['INPUT_TOKEN'] = '<mock-github-token>'
process.env['INPUT_BIN'] = 'npx code-pushup'
process.env['INPUT_DIRECTORY'] = workDir
process.env['INPUT_OUTPUT'] = '.code-pushup'
process.env['INPUT_RETENTION'] = '14'
process.env['INPUT_TASK'] = 'code-pushup'
process.env['INPUT_SILENT'] = 'true'
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ inputs:
directory:
description: Custom working directory
required: false
output:
description:
Custom report output directory (use '{project}'-syntax in monorepo mode)
required: false
default: .code-pushup
silent:
description: Silence logs from Code Pushup CLI
required: true
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading