Skip to content

Commit f53beac

Browse files
authored
Add first implementation (#5)
1 parent 4c8cda6 commit f53beac

File tree

13 files changed

+126600
-944
lines changed

13 files changed

+126600
-944
lines changed

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"skipFiles": [
12+
"<node_internals>/**"
13+
],
14+
"preLaunchTask": "tsc: build - tsconfig.json",
15+
"outFiles": ["${workspaceFolder}/lib/**/*.js"],
16+
"program": "${workspaceFolder}/src/main.ts",
17+
"args": ["--sarifFile", "${workspaceFolder}/testdata/java.sarif", "--cweFile", "${workspaceFolder}/testdata/1344.xml"],
18+
}
19+
]
20+
}

__tests__/main.test.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +0,0 @@
1-
import {wait} from '../src/wait'
2-
import * as process from 'process'
3-
import * as cp from 'child_process'
4-
import * as path from 'path'
5-
import {expect, test} from '@jest/globals'
6-
7-
test('throws invalid number', async () => {
8-
const input = parseInt('foo', 10)
9-
await expect(wait(input)).rejects.toThrow('milliseconds not a number')
10-
})
11-
12-
test('wait 500 ms', async () => {
13-
const start = new Date()
14-
await wait(500)
15-
const end = new Date()
16-
var delta = Math.abs(end.getTime() - start.getTime())
17-
expect(delta).toBeGreaterThan(450)
18-
})
19-
20-
// shows how the runner will run a javascript action with env / stdout protocol
21-
test('test runs', () => {
22-
process.env['INPUT_MILLISECONDS'] = '500'
23-
const np = process.execPath
24-
const ip = path.join(__dirname, '..', 'lib', 'main.js')
25-
const options: cp.ExecFileSyncOptions = {
26-
env: process.env
27-
}
28-
console.log(cp.execFileSync(np, [ip], options).toString())
29-
})

action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: 'Sarif To Security Standard Report'
22
description: 'Compare a SARIF results file to a security standard CWE list and produce a report'
33
author: 'GitHub, Inc'
44
inputs:
5-
milliseconds: # change this
5+
sarifFile:
66
required: true
7-
description: 'input description here'
8-
default: 'default value if applicable'
7+
description: 'The SARIF file to compare'
8+
cweFile:
9+
required: true
10+
description: 'The CWE file to compare'
911
runs:
1012
using: 'node16'
1113
main: 'dist/index.js'

0 commit comments

Comments
 (0)