Skip to content

Commit 088191e

Browse files
committed
Add skipComment input
1 parent 00fcb34 commit 088191e

File tree

8 files changed

+843
-2949
lines changed

8 files changed

+843
-2949
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ The action may be customized using the following optional inputs:
6767
| `token` | GitHub token for authorizing GitHub API requests | `${{ github.token }}` |
6868
| `annotations` | Toggles if annotations should be created for relevant Code PushUp issues | `true` |
6969
| `artifacts` | Toggles if artifacts will we uploaded/downloaded | `true` |
70+
| `skipComment` | Toggles if comparison comment is posted to PR | `false` |
7071
| `retention` | Artifact retention period in days | from repository settings |
7172
| `directory` | Directory in which `code-pushup` should run | `process.cwd()` |
7273
| `config` | Path to config file (`--config` option) | see [`@code-pushup/cli` docs](https://github.com/code-pushup/cli/tree/main/packages/cli#configuration) |

__tests__/main.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { ArtifactClient } from '@actions/artifact'
22
import core from '@actions/core'
33
import github from '@actions/github'
4-
import { jest } from '@jest/globals'
54
import type { Report } from '@code-pushup/models'
5+
import { jest } from '@jest/globals'
66
import type { components } from '@octokit/openapi-types'
77
import type { RestEndpointMethodTypes } from '@octokit/plugin-rest-endpoint-methods'
88
import {
@@ -72,6 +72,7 @@ describe('code-pushup action', () => {
7272
process.env['INPUT_SILENT'] = 'true'
7373
process.env['INPUT_ARTIFACTS'] = 'true'
7474
process.env['INPUT_ANNOTATIONS'] = 'true'
75+
process.env['INPUT_SKIPCOMMENT'] = 'false'
7576

7677
jest.spyOn(github.context, 'repo', 'get').mockReturnValue({
7778
owner: 'dunder-mifflin',

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ inputs:
7676
description: Create file annotations in GitHub
7777
required: true
7878
default: true
79+
skipComment:
80+
description: Skip PR comment
81+
required: true
82+
default: false
7983

8084
outputs:
8185
artifact-id:

dist/index.js

Lines changed: 830 additions & 2941 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/licenses.txt

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/inputs.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type ActionInputs = {
1919
artifacts: boolean
2020
retention: number | null
2121
annotations: boolean
22+
skipComment: boolean
2223
}
2324

2425
export function parseInputs(): ActionInputs {
@@ -35,6 +36,7 @@ export function parseInputs(): ActionInputs {
3536
const artifacts = core.getBooleanInput('artifacts')
3637
const retention = parseInteger(core.getInput('retention'))
3738
const annotations = core.getBooleanInput('annotations')
39+
const skipComment = core.getBooleanInput('skipComment')
3840

3941
return {
4042
monorepo,
@@ -49,7 +51,8 @@ export function parseInputs(): ActionInputs {
4951
silent,
5052
artifacts,
5153
retention,
52-
annotations
54+
annotations,
55+
skipComment
5356
}
5457
}
5558

src/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export function createOptions(inputs: ActionInputs): Required<Options> {
1313
bin: inputs.bin,
1414
config: inputs.config,
1515
detectNewIssues: inputs.annotations,
16+
skipComment: inputs.skipComment,
1617
silent: inputs.silent,
1718
debug: core.isDebug(),
1819
logger: {

0 commit comments

Comments
 (0)