Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
78 lines (72 loc) · 2.45 KB
/
Copy pathaction.yml
File metadata and controls
78 lines (72 loc) · 2.45 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Runs CodeQL
description: |
Runs all CodeQL necessary actions to scan and upload the result to Github
inputs:
auto-build:
description: Use CodeQL's auto-build.
required: false
default: "false"
build-script:
description: Optional path to an executable file that will perform a full, uncached, build for CodeQL analysis.
required: false
languages:
description: The languages of the checks to run, separated by a comma. Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support.
required: true
category:
description: String used by Code Scanning for matching the analyses.
required: false
working-directory:
description: Relative path under $GITHUB_WORKSPACE where the root project is located.
required: false
default: "."
runs:
using: composite
steps:
- name: Write CodeQL config file
id: config
shell: bash
run: |
buildDir="${{ inputs.working-directory }}/build"
configFile="${buildDir}/codeqlconfig.yaml"
mkdir -p "$buildDir"
cat > "$configFile" <<'EOF'
paths:
- ${{ inputs.working-directory }}
queries:
- uses: security-extended
EOF
echo "config-file=$configFile" >> $GITHUB_OUTPUT
- name: Initialize CodeQL
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
with:
build-mode: |-
${{ case(
inputs.build-script != '', 'manual',
inputs.auto-build == 'true', 'autobuild',
'none'
) }}
config-file: ${{ steps.config.outputs.config-file }}
languages: ${{ inputs.languages }}
- name: Execute build script
if: inputs.build-script != ''
shell: bash
run: |
if [ -x "${{ inputs.working-directory }}/${{ inputs.build-script }}" ]; then
exec "${{ inputs.working-directory }}/${{ inputs.build-script }}"
exit 0
fi
${{ inputs.build-script }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
env:
CODEQL_ACTION_EXTRA_OPTIONS: >
{
"database": {
"run-queries": [
"--additional-packs=${{ github.action_path }}",
"--extension-packs=equisoft-actions/codeql-actions-models"
]
}
}
with:
category: ${{ inputs.category }}