@fabasoad/sarif-to-slack 1.3.3 → 1.3.4
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 +10 -6
- 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 +4 -0
- package/README.md +47 -45
- package/dist/index.cjs +3 -3
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +14 -14
- package/.github/dependabot.yml +0 -11
|
@@ -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,6 +22,7 @@ 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 }}
|
|
@@ -34,12 +35,12 @@ jobs:
|
|
|
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.0
|
|
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.3
|
|
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.47.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.10
|
|
85
85
|
hooks:
|
|
86
86
|
- id: actionlint
|
|
87
87
|
args: ["-pyflakes=", "-shellcheck="]
|
package/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
nodejs
|
|
1
|
+
nodejs 25.6.1
|
package/LICENSE
CHANGED
package/Makefile
CHANGED
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/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.4";
|
|
179
|
+
var sha = "7dcec52f94545c8b5319ca92f2e77130b7bd0f3a";
|
|
180
|
+
var buildAt = "2026-02-13T14:07:20Z";
|
|
181
181
|
|
|
182
182
|
// src/system.ts
|
|
183
183
|
function logMetadata() {
|
package/dist/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabasoad/sarif-to-slack",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "TypeScript library to send results of SARIF file to Slack webhook URL.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/fabasoad/sarif-to-slack#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@slack/webhook": "7.0.
|
|
46
|
-
"@types/sarif": "2.1.7",
|
|
47
|
-
"tslog": "4.10.2",
|
|
48
|
-
"zod": "4.
|
|
45
|
+
"@slack/webhook": "~7.0.7",
|
|
46
|
+
"@types/sarif": "~2.1.7",
|
|
47
|
+
"tslog": "~4.10.2",
|
|
48
|
+
"zod": "~4.3.6"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@biomejs/biome": "2.
|
|
52
|
-
"@microsoft/api-documenter": "7.
|
|
53
|
-
"@microsoft/api-extractor": "7.
|
|
54
|
-
"@types/jest": "30.0.0",
|
|
55
|
-
"jest": "30.2.0",
|
|
56
|
-
"jest-circus": "30.2.0",
|
|
57
|
-
"ts-jest": "29.4.
|
|
58
|
-
"tsup": "8.5.
|
|
59
|
-
"typescript": "5.9.3"
|
|
51
|
+
"@biomejs/biome": "~2.3.15",
|
|
52
|
+
"@microsoft/api-documenter": "~7.28.9",
|
|
53
|
+
"@microsoft/api-extractor": "~7.56.3",
|
|
54
|
+
"@types/jest": "~30.0.0",
|
|
55
|
+
"jest": "~30.2.0",
|
|
56
|
+
"jest-circus": "~30.2.0",
|
|
57
|
+
"ts-jest": "~29.4.6",
|
|
58
|
+
"tsup": "~8.5.1",
|
|
59
|
+
"typescript": "~5.9.3"
|
|
60
60
|
}
|
|
61
61
|
}
|