-
Notifications
You must be signed in to change notification settings - Fork 1.6k
54 lines (53 loc) · 1.89 KB
/
codacy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Codacy
permissions: read-all
on: [ push, pull_request ]
jobs:
security-scan:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
actions: read
contents: read
security-events: write
if: github.event.repository.fork == false
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.codacy.com:443
api.github.com:443
auth.docker.io:443
github.com:443
golang.org:443
objects.githubusercontent.com:443
production.cloudflare.docker.com:443
raw.githubusercontent.com:443
registry-1.docker.io:443
*.blob.core.windows.net:443
- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Run Codacy Analysis
uses: codacy/codacy-analysis-cli-action@master
continue-on-error: true
with:
format: sarif
output: results.sarif
gh-code-scanning-compat: true
max-allowed-issues: 2147483647
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
with:
files: results.sarif
- name: Remove duplicate runs
if: steps.check_files.outputs.files_exists == 'true'
run: jq -c '.runs |= unique_by({tool, invocations, results})' < results.sarif > codacy.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@ccf74c947955fd1cf117aef6a0e4e66191ef6f61 # v3.25.4
if: steps.check_files.outputs.files_exists == 'true'
continue-on-error: true
with:
sarif_file: codacy.sarif