Skip to content

Commit 2a34a61

Browse files
Merge pull request #71 from ctrf-io/fix/expose-fetch-command
feat: allow fetch previous results for custom
2 parents 3c5d8e3 + a1fda7b commit 2a34a61

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ For test annotations, add the `annotate` argument to your workflow yaml:
326326
- `--exit-on-fail`: Sets the action status to failed when a failed tests is
327327
found
328328
- `--use-suite-name`: Prefix test name with suite name
329+
- `--fetch-previous-results`: Always fetch previous workflow runs when using
330+
custom templates
329331

330332
## Storing Artifacts
331333

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "github-actions-ctrf",
3-
"version": "0.0.57",
3+
"version": "0.0.58",
44
"description": "View test results directly within your GitHub workflow summary and Pull Requests",
55
"main": "index.js",
66
"scripts": {

src/core/cli.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env node
2+
process.env.RUN_MODE = 'cli'
3+
24
import yargs from 'yargs/yargs'
35
import { hideBin } from 'yargs/helpers'
46
import { exitActionOnFail, getAllGitHubContext, handleError } from '../github'
@@ -34,6 +36,7 @@ export interface Arguments {
3436
commentTag?: string
3537
results?: number
3638
exitOnFail?: boolean
39+
fetchPreviousResults?: boolean
3740
}
3841

3942
async function main(): Promise<void> {
@@ -315,6 +318,11 @@ async function main(): Promise<void> {
315318
type: 'string',
316319
description: 'Tag to use to match Pull Request comments with'
317320
})
321+
.options('fetch-previous-results', {
322+
type: 'boolean',
323+
description:
324+
'Always fetch previous workflow runs when using custom templates.'
325+
})
318326
.help()
319327
.alias('help', 'h')
320328
.parseSync()

src/core/inputs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function getCliInputs(args: Arguments): Inputs {
3636
useSuiteName: args.useSuiteName || false,
3737
previousResultsMax: args.rows || 10,
3838
metricsReportsMax: args.results || 100,
39-
fetchPreviousResults: args._.includes('fetch-previous-results'),
39+
fetchPreviousResults: args.fetchPreviousResults || false,
4040
updateComment: args.updateComment || false,
4141
overwriteComment: args.overwriteComment || false,
4242
commentTag: args.commentTag || '',

0 commit comments

Comments
 (0)