@fabasoad/sarif-to-slack 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +7 -7
- package/.github/ISSUE_TEMPLATE/feature_request.md +4 -4
- package/.github/workflows/linting.yml +6 -2
- package/.github/workflows/release.yml +11 -7
- package/.github/workflows/security.yml +3 -3
- package/.github/workflows/send-sarif-to-slack.yml +2 -2
- package/.github/workflows/sync-labels.yml +4 -0
- package/.github/workflows/unit-tests.yml +2 -0
- package/.github/workflows/update-license.yml +3 -0
- package/.pre-commit-config.yaml +12 -12
- package/.tool-versions +1 -1
- package/LICENSE +1 -1
- package/Makefile +5 -1
- package/README.md +47 -45
- package/api-extractor.json +2 -2
- package/dist/index.cjs +10 -3
- package/dist/index.d.ts +491 -6
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +14 -14
- package/tsconfig.json +2 -3
- package/.github/dependabot.yml +0 -11
- package/dist/sarif-to-slack.d.ts +0 -562
|
@@ -7,32 +7,32 @@ assignees: fabasoad
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Describe the bug
|
|
11
11
|
|
|
12
12
|
A clear and concise description of what the bug is.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## Steps to Reproduce
|
|
15
15
|
|
|
16
16
|
1. Run '...'
|
|
17
17
|
2. See error
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Expected behavior
|
|
20
20
|
|
|
21
21
|
A clear and concise description of what you expected to happen.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
## Actual behavior
|
|
24
24
|
|
|
25
25
|
A clear and concise description of what is happening now.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
## Screenshots
|
|
28
28
|
|
|
29
29
|
If applicable, add screenshots to help explain your problem.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
## Technical information (please complete the following information)
|
|
32
32
|
|
|
33
33
|
- OS: [e.g. Windows 10 Enterprise v.1909 (OS Build 18363.720)]
|
|
34
34
|
- `sarif-to-slack` version [e.g. 0.1.1]
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
## Additional context
|
|
37
37
|
|
|
38
38
|
Add any other context about the problem here.
|
|
@@ -7,20 +7,20 @@ assignees: fabasoad
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Is your feature request related to a problem? Please describe
|
|
11
11
|
|
|
12
12
|
A clear and concise description of what the problem is. Ex. I'm always
|
|
13
13
|
frustrated when [...]
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Describe the solution you'd like
|
|
16
16
|
|
|
17
17
|
A clear and concise description of what you want to happen.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Describe alternatives you've considered
|
|
20
20
|
|
|
21
21
|
A clear and concise description of any alternative solutions or features you've
|
|
22
22
|
considered.
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
## Additional context
|
|
25
25
|
|
|
26
26
|
Add any other context or screenshots about the feature request here.
|
|
@@ -19,14 +19,18 @@ on: # yamllint disable-line rule:truthy
|
|
|
19
19
|
- js-lint
|
|
20
20
|
- pre-commit
|
|
21
21
|
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
|
|
22
25
|
jobs:
|
|
23
26
|
js-lint:
|
|
24
27
|
name: JS Lint
|
|
25
|
-
if:
|
|
28
|
+
if: contains(fromJSON('["all", "js-lint"]'), github.event.inputs.linter || 'all')
|
|
26
29
|
uses: fabasoad/reusable-workflows/.github/workflows/wf-js-lint.yml@main
|
|
30
|
+
|
|
27
31
|
pre-commit:
|
|
28
32
|
name: Pre-commit
|
|
29
|
-
if:
|
|
33
|
+
if: contains(fromJSON('["all", "pre-commit"]'), github.event.inputs.linter || 'all')
|
|
30
34
|
uses: fabasoad/reusable-workflows/.github/workflows/wf-pre-commit.yml@main
|
|
31
35
|
with:
|
|
32
36
|
skip-hooks: "audit, build, lint, test"
|
|
@@ -22,24 +22,25 @@ jobs:
|
|
|
22
22
|
permissions:
|
|
23
23
|
contents: write
|
|
24
24
|
packages: write
|
|
25
|
+
id-token: write
|
|
25
26
|
outputs:
|
|
26
27
|
ref: ${{ steps.metadata.outputs.ref }}
|
|
27
28
|
ref-name: ${{ steps.metadata.outputs.ref-name }}
|
|
28
29
|
steps:
|
|
29
30
|
- name: Get GitHub token
|
|
30
|
-
uses: actions/create-github-app-token@
|
|
31
|
+
uses: actions/create-github-app-token@v3
|
|
31
32
|
id: github-app
|
|
32
33
|
with:
|
|
33
34
|
app-id: ${{ vars.GH_APP_CONTENTS_CRUD_APP_ID }}
|
|
34
35
|
private-key: ${{ secrets.GH_APP_CONTENTS_CRUD_PRIVATE_KEY }}
|
|
35
36
|
|
|
36
37
|
- name: Checkout ${{ github.repository }}
|
|
37
|
-
uses: actions/checkout@
|
|
38
|
+
uses: actions/checkout@v6
|
|
38
39
|
with:
|
|
39
40
|
token: "${{ steps.github-app.outputs.token }}"
|
|
40
41
|
|
|
41
42
|
- name: Setup Node
|
|
42
|
-
uses: actions/setup-node@
|
|
43
|
+
uses: actions/setup-node@v6
|
|
43
44
|
with:
|
|
44
45
|
node-version-file: ".tool-versions"
|
|
45
46
|
cache: "npm"
|
|
@@ -56,10 +57,10 @@ jobs:
|
|
|
56
57
|
BUMP_STRATEGY: "${{ github.event.inputs.bump-strategy }}"
|
|
57
58
|
GH_TOKEN: "${{ steps.github-app.outputs.token }}"
|
|
58
59
|
run: |
|
|
59
|
-
|
|
60
|
-
user_id="$(gh api "/users/${
|
|
61
|
-
git config user.email "${user_id}+${
|
|
62
|
-
git config user.name "${
|
|
60
|
+
user_name="${{ steps.github-app.outputs.app-slug }}[bot]"
|
|
61
|
+
user_id="$(gh api "/users/${user_name}" --jq .id)"
|
|
62
|
+
git config user.email "${user_id}+${user_name}@users.noreply.github.com"
|
|
63
|
+
git config user.name "${user_name}"
|
|
63
64
|
npm run version:${BUMP_STRATEGY}
|
|
64
65
|
|
|
65
66
|
- name: Get metadata
|
|
@@ -73,6 +74,7 @@ jobs:
|
|
|
73
74
|
uses: JS-DevTools/npm-publish@v4
|
|
74
75
|
with:
|
|
75
76
|
token: "${{ secrets.NPM_TOKEN }}"
|
|
77
|
+
registry: "https://registry.npmjs.org"
|
|
76
78
|
|
|
77
79
|
- name: Publish to GitHub Packages
|
|
78
80
|
uses: JS-DevTools/npm-publish@v4
|
|
@@ -83,6 +85,8 @@ jobs:
|
|
|
83
85
|
name: GitHub
|
|
84
86
|
needs: [publish]
|
|
85
87
|
uses: fabasoad/reusable-workflows/.github/workflows/wf-github-release.yml@main
|
|
88
|
+
permissions:
|
|
89
|
+
contents: write
|
|
86
90
|
with:
|
|
87
91
|
bump-tags: false
|
|
88
92
|
ref: ${{ needs.publish.outputs.ref }}
|
|
@@ -18,10 +18,10 @@ on: # yamllint disable-line rule:truthy
|
|
|
18
18
|
jobs:
|
|
19
19
|
sast:
|
|
20
20
|
name: SAST
|
|
21
|
+
uses: fabasoad/reusable-workflows/.github/workflows/wf-security-sast.yml@main
|
|
21
22
|
permissions:
|
|
22
23
|
contents: read
|
|
23
24
|
security-events: write
|
|
24
|
-
uses: fabasoad/reusable-workflows/.github/workflows/wf-security-sast.yml@main
|
|
25
25
|
with:
|
|
26
|
-
code-scanning: ${{ (
|
|
27
|
-
sca: ${{ (
|
|
26
|
+
code-scanning: ${{ contains(fromJSON('["all", "code-scanning"]'), github.event.inputs.security-type || 'all') }}
|
|
27
|
+
sca: ${{ contains(fromJSON('["all", "sca"]'), github.event.inputs.security-type || 'all') }}
|
|
@@ -163,7 +163,7 @@ jobs:
|
|
|
163
163
|
runs-on: ubuntu-latest
|
|
164
164
|
steps:
|
|
165
165
|
- name: Checkout ${{ github.repository }}
|
|
166
|
-
uses: actions/checkout@
|
|
166
|
+
uses: actions/checkout@v6
|
|
167
167
|
- name: Determine SARIF file
|
|
168
168
|
id: sarif-file
|
|
169
169
|
env:
|
|
@@ -273,7 +273,7 @@ jobs:
|
|
|
273
273
|
fi
|
|
274
274
|
echo "value=${value}" >> "$GITHUB_OUTPUT"
|
|
275
275
|
- name: Setup node
|
|
276
|
-
uses: actions/setup-node@
|
|
276
|
+
uses: actions/setup-node@v6
|
|
277
277
|
with:
|
|
278
278
|
node-version-file: ".tool-versions"
|
|
279
279
|
- name: Install dependencies
|
package/.pre-commit-config.yaml
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
default_install_hook_types: ["pre-commit", "pre-push"]
|
|
3
3
|
default_stages: ["pre-commit", "pre-push"]
|
|
4
4
|
exclude: ^(dist/.*|etc/.*|node_modules/.*|temp/.*|test-data/.*)$
|
|
5
|
-
minimum_pre_commit_version: 4.
|
|
5
|
+
minimum_pre_commit_version: 4.4.0
|
|
6
6
|
repos:
|
|
7
7
|
- repo: local
|
|
8
8
|
hooks:
|
|
9
9
|
- id: build
|
|
10
10
|
name: Build
|
|
11
11
|
entry: make build
|
|
12
|
-
language:
|
|
12
|
+
language: unsupported
|
|
13
13
|
pass_filenames: false
|
|
14
14
|
verbose: true
|
|
15
15
|
stages: ["pre-push"]
|
|
16
16
|
- id: lint
|
|
17
17
|
name: Lint
|
|
18
18
|
entry: make lint
|
|
19
|
-
language:
|
|
19
|
+
language: unsupported
|
|
20
20
|
pass_filenames: false
|
|
21
21
|
verbose: false
|
|
22
22
|
stages: ["pre-push"]
|
|
23
23
|
- id: test
|
|
24
24
|
name: Unit tests
|
|
25
25
|
entry: make test
|
|
26
|
-
language:
|
|
26
|
+
language: unsupported
|
|
27
27
|
pass_filenames: false
|
|
28
28
|
verbose: true
|
|
29
29
|
stages: ["pre-push"]
|
|
@@ -31,7 +31,7 @@ repos:
|
|
|
31
31
|
- id: audit
|
|
32
32
|
name: npm audit
|
|
33
33
|
entry: make audit
|
|
34
|
-
language:
|
|
34
|
+
language: unsupported
|
|
35
35
|
pass_filenames: false
|
|
36
36
|
verbose: false
|
|
37
37
|
stages: ["pre-push"]
|
|
@@ -40,11 +40,11 @@ repos:
|
|
|
40
40
|
hooks:
|
|
41
41
|
- id: detect-secrets
|
|
42
42
|
- repo: https://github.com/gitleaks/gitleaks
|
|
43
|
-
rev: v8.
|
|
43
|
+
rev: v8.30.1
|
|
44
44
|
hooks:
|
|
45
45
|
- id: gitleaks
|
|
46
46
|
- repo: https://github.com/fabasoad/pre-commit-snyk
|
|
47
|
-
rev: v1.0.
|
|
47
|
+
rev: v1.0.3
|
|
48
48
|
hooks:
|
|
49
49
|
- id: snyk-test
|
|
50
50
|
args:
|
|
@@ -52,7 +52,7 @@ repos:
|
|
|
52
52
|
- --hook-args=--log-level debug
|
|
53
53
|
stages: ["pre-push"]
|
|
54
54
|
- repo: https://github.com/fabasoad/pre-commit-grype
|
|
55
|
-
rev: v0.6.
|
|
55
|
+
rev: v0.6.4
|
|
56
56
|
hooks:
|
|
57
57
|
- id: grype-dir
|
|
58
58
|
args:
|
|
@@ -60,7 +60,7 @@ repos:
|
|
|
60
60
|
- --hook-args=--log-level debug
|
|
61
61
|
stages: ["pre-push"]
|
|
62
62
|
- repo: https://github.com/google/osv-scanner
|
|
63
|
-
rev: v2.
|
|
63
|
+
rev: v2.3.5
|
|
64
64
|
hooks:
|
|
65
65
|
- id: osv-scanner
|
|
66
66
|
args:
|
|
@@ -69,19 +69,19 @@ repos:
|
|
|
69
69
|
stages: ["pre-push"]
|
|
70
70
|
# Markdown
|
|
71
71
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
72
|
-
rev: v0.
|
|
72
|
+
rev: v0.48.0
|
|
73
73
|
hooks:
|
|
74
74
|
- id: markdownlint-fix
|
|
75
75
|
stages: ["pre-commit"]
|
|
76
76
|
# Yaml
|
|
77
77
|
- repo: https://github.com/adrienverge/yamllint
|
|
78
|
-
rev: v1.
|
|
78
|
+
rev: v1.38.0
|
|
79
79
|
hooks:
|
|
80
80
|
- id: yamllint
|
|
81
81
|
stages: ["pre-push"]
|
|
82
82
|
# GitHub Actions
|
|
83
83
|
- repo: https://github.com/rhysd/actionlint
|
|
84
|
-
rev: v1.7.
|
|
84
|
+
rev: v1.7.12
|
|
85
85
|
hooks:
|
|
86
86
|
- id: actionlint
|
|
87
87
|
args: ["-pyflakes=", "-shellcheck="]
|
package/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
nodejs
|
|
1
|
+
nodejs 25.9.0
|
package/LICENSE
CHANGED
package/Makefile
CHANGED
|
@@ -43,7 +43,11 @@ npm/update:
|
|
|
43
43
|
|
|
44
44
|
.PHONY: pre-commit/update
|
|
45
45
|
pre-commit/update:
|
|
46
|
-
@pre-commit autoupdate
|
|
46
|
+
@command -v prek >/dev/null 2>&1 && prek auto-update || pre-commit autoupdate
|
|
47
47
|
|
|
48
48
|
.PHONY: update
|
|
49
49
|
update: npm/update pre-commit/update
|
|
50
|
+
|
|
51
|
+
.PHONY: outdated
|
|
52
|
+
outdated:
|
|
53
|
+
@npm outdated
|
package/README.md
CHANGED
|
@@ -37,53 +37,55 @@ import {
|
|
|
37
37
|
SendIf
|
|
38
38
|
} from '@fabasoad/sarif-to-slack';
|
|
39
39
|
|
|
40
|
-
const client: SarifToSlackClient = await SarifToSlackClient.create(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
const client: SarifToSlackClient = await SarifToSlackClient.create(
|
|
41
|
+
'https://hooks.slack.com/services/your/webhook/url',
|
|
42
|
+
{
|
|
43
|
+
username: 'SARIF to Slack Bot',
|
|
44
|
+
iconUrl: 'https://example.com/icon.png',
|
|
45
|
+
color: {
|
|
46
|
+
default: new Color('failure'),
|
|
47
|
+
empty: new Color('success'),
|
|
48
|
+
bySeverity: {
|
|
49
|
+
critical: new Color('#ff0000'),
|
|
50
|
+
high: new Color('#ff4500'),
|
|
51
|
+
medium: new Color('#ffa500'),
|
|
52
|
+
low: new Color('#ffff00'),
|
|
53
|
+
none: new Color('#808080'),
|
|
54
|
+
unknown: new Color('#800080'),
|
|
55
|
+
},
|
|
56
|
+
byLevel: {
|
|
57
|
+
error: new Color('#ff0000'),
|
|
58
|
+
warning: new Color('#ffa500'),
|
|
59
|
+
note: new Color('#ffff00'),
|
|
60
|
+
none: new Color('#808080'),
|
|
61
|
+
unknown: new Color('#800080'),
|
|
62
|
+
},
|
|
54
63
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
none: new Color('#808080'),
|
|
60
|
-
unknown: new Color('#800080'),
|
|
64
|
+
sarif: {
|
|
65
|
+
path: 'path/to/your/sarif-files',
|
|
66
|
+
recursive: true,
|
|
67
|
+
extension: 'sarif',
|
|
61
68
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
include: true
|
|
83
|
-
},
|
|
84
|
-
representation: RepresentationType.CompactGroupByToolNamePerSeverity,
|
|
85
|
-
sendIf: SendIf.MediumOrHigher,
|
|
86
|
-
});
|
|
69
|
+
header: {
|
|
70
|
+
include: true,
|
|
71
|
+
value: 'SARIF Analysis Results'
|
|
72
|
+
},
|
|
73
|
+
footer: {
|
|
74
|
+
include: true,
|
|
75
|
+
type: FooterType.PLAIN_TEXT,
|
|
76
|
+
value: 'Generated by @fabasoad/sarif-to-slack'
|
|
77
|
+
},
|
|
78
|
+
actor: {
|
|
79
|
+
include: true,
|
|
80
|
+
value: 'fabasoad'
|
|
81
|
+
},
|
|
82
|
+
run: {
|
|
83
|
+
include: true
|
|
84
|
+
},
|
|
85
|
+
representation: RepresentationType.CompactGroupByToolNamePerSeverity,
|
|
86
|
+
sendIf: SendIf.MediumOrHigher,
|
|
87
|
+
}
|
|
88
|
+
);
|
|
87
89
|
await client.send();
|
|
88
90
|
```
|
|
89
91
|
|
package/api-extractor.json
CHANGED
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
/**
|
|
265
265
|
* (REQUIRED) Whether to generate the .d.ts rollup file.
|
|
266
266
|
*/
|
|
267
|
-
"enabled": true
|
|
267
|
+
"enabled": true,
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
270
|
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
279
279
|
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
|
|
280
280
|
*/
|
|
281
|
-
|
|
281
|
+
"untrimmedFilePath": "<projectFolder>/dist/index.d.ts",
|
|
282
282
|
|
|
283
283
|
/**
|
|
284
284
|
* Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release.
|
package/dist/index.cjs
CHANGED
|
@@ -175,9 +175,9 @@ var import_zod2 = require("zod");
|
|
|
175
175
|
var import_zod = require("zod");
|
|
176
176
|
|
|
177
177
|
// src/metadata.json
|
|
178
|
-
var version = "1.3.
|
|
179
|
-
var sha = "
|
|
180
|
-
var buildAt = "
|
|
178
|
+
var version = "1.3.5";
|
|
179
|
+
var sha = "4b44572f95bfdaab5159a2bd89a3ed2b193b55aa";
|
|
180
|
+
var buildAt = "2026-04-04T14:25:40Z";
|
|
181
181
|
|
|
182
182
|
// src/system.ts
|
|
183
183
|
function logMetadata() {
|
|
@@ -565,6 +565,7 @@ var Column = class {
|
|
|
565
565
|
this.header = header;
|
|
566
566
|
this._cells = new Array(cellsCount);
|
|
567
567
|
}
|
|
568
|
+
header;
|
|
568
569
|
_logger = new Logger("Column");
|
|
569
570
|
_cells;
|
|
570
571
|
get total() {
|
|
@@ -596,6 +597,7 @@ var Cell = class {
|
|
|
596
597
|
this._value = _value;
|
|
597
598
|
this._width = _value.toString().length;
|
|
598
599
|
}
|
|
600
|
+
_value;
|
|
599
601
|
_width;
|
|
600
602
|
setWidth(width) {
|
|
601
603
|
this._width = width > this._width ? width : this._width;
|
|
@@ -621,6 +623,8 @@ var Row = class {
|
|
|
621
623
|
this._cells = Array.from({ length: cellsCount }, () => new Cell());
|
|
622
624
|
this._totalWidth = 1;
|
|
623
625
|
}
|
|
626
|
+
_header;
|
|
627
|
+
headerWidth;
|
|
624
628
|
_logger = new Logger("Row");
|
|
625
629
|
_cells;
|
|
626
630
|
_totalWidth;
|
|
@@ -729,6 +733,9 @@ var TableGroupRepresentation = class extends Representation {
|
|
|
729
733
|
this._keyPer = _keyPer;
|
|
730
734
|
this._values = _values;
|
|
731
735
|
}
|
|
736
|
+
_keyBy;
|
|
737
|
+
_keyPer;
|
|
738
|
+
_values;
|
|
732
739
|
_logger = new Logger("TableGroupRepresentation");
|
|
733
740
|
groupFindingsPer(findings) {
|
|
734
741
|
return findings.reduce(
|