mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
Create annotations where exceptions were thrown
This commit is contained in:
parent
6750c31e23
commit
fc8cfe0f32
15 changed files with 1606 additions and 19 deletions
22
src/utils/git.ts
Normal file
22
src/utils/git.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import * as core from '@actions/core'
|
||||
import exec from './exec'
|
||||
|
||||
export async function listFiles(): Promise<string[]> {
|
||||
core.startGroup('Listing all files tracked by git')
|
||||
let output = ''
|
||||
try {
|
||||
output = (await exec('git', ['ls-files', '-z'])).stdout
|
||||
} finally {
|
||||
fixStdOutNullTermination()
|
||||
core.endGroup()
|
||||
}
|
||||
|
||||
return output.split('\u0000').filter(s => s.length > 0)
|
||||
}
|
||||
|
||||
function fixStdOutNullTermination(): void {
|
||||
// Previous command uses NULL as delimiters and output is printed to stdout.
|
||||
// We have to make sure next thing written to stdout will start on new line.
|
||||
// Otherwise things like ::set-output wouldn't work.
|
||||
core.info('')
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue