Skip to content

Commit a2ed07e

Browse files
author
Alvaro Muñoz
committed
Update scan action
1 parent f73571a commit a2ed07e

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

.github/action/dist/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28606,7 +28606,7 @@ async function newCodeQL() {
2860628606
return {
2860728607
language: "yaml",
2860828608
path: await findCodeQL(),
28609-
pack: "githubsecuritylab/actions-queries",
28609+
pack: "githubsecuritylab/actions-all",
2861028610
suite: `codeql-suites/${core.getInput("suite") || "actions-code-scanning"}.qls`,
2861128611
source_root: core.getInput("source-root"),
2861228612
output: core.getInput("sarif"),
@@ -28706,6 +28706,15 @@ async function codeqlDatabaseAnalyze(codeql, database_path) {
2870628706
"--output",
2870728707
codeql_output,
2870828708
];
28709+
const extPackPath = process.env["EXTPACK_PATH"];
28710+
const extPackName = process.env["EXTPACK_NAME"];
28711+
if (extPackPath !== undefined &&
28712+
extPackName !== undefined &&
28713+
extPackPath !== "" &&
28714+
extPackName !== "") {
28715+
cmd.push("--additional-packs", extPackPath);
28716+
cmd.push("--extension-packs", extPackName);
28717+
}
2870928718
// remote pack or local pack
2871028719
if (codeql.pack.startsWith("githubsecuritylab/")) {
2871128720
var suite = codeql.pack + ":" + codeql.suite;

.github/action/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@actions/tool-cache": "^2.0.1"
4141
},
4242
"devDependencies": {
43-
"@types/node": "^20.6.0",
43+
"@types/node": "^20.12.7",
4444
"@vercel/ncc": "^0.38.0",
4545
"prettier": "^3.0.3",
4646
"typescript": "^5.2.2"

.github/action/src/codeql.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,12 @@ export async function codeqlDatabaseAnalyze(
149149

150150
const extPackPath = process.env["EXTPACK_PATH"];
151151
const extPackName = process.env["EXTPACK_NAME"];
152-
if (extPackPath !== undefined && extPackName !== undefined) {
152+
if (
153+
extPackPath !== undefined &&
154+
extPackName !== undefined &&
155+
extPackPath !== "" &&
156+
extPackName !== ""
157+
) {
153158
cmd.push("--additional-packs", extPackPath);
154159
cmd.push("--extension-packs", extPackName);
155160
}

action.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,9 @@ runs:
3333
mkdir workflow-extpack
3434
cd workflow-extpack
3535
36-
# Store the extension pack file
37-
cat > models.json << 'EOF'
38-
${{ inputs.workflow-models }}
39-
EOF
40-
4136
# Store the extension pack file
4237
cat > models.yml << 'EOF'
43-
extensions:
44-
- addsTo:
45-
pack: githubsecuritylab/actions-all
46-
extensible: workflowDataModel
47-
data: []
38+
${{ inputs.workflow-models }}
4839
EOF
4940
5041
# Create QLPack
@@ -69,7 +60,7 @@ runs:
6960
INPUT_SOURCE-ROOT: ${{ inputs.source-root }}
7061
INPUT_SARIF-OUTPUT: ${{ inputs.sarif-output }}
7162
INPUT_SUITE: ${{ inputs.suite }}
72-
EXTPACK_PATH: ${{ inputs.extpack-path }}
73-
EXTPACK_NAME: ${{ inputs.extpack-name }}
63+
EXTPACK_PATH: ${{ env.EXTPACK_PATH }}
64+
EXTPACK_NAME: ${{ env.EXTPACK_NAME }}
7465
run: |
7566
node ${{ github.action_path }}/.github/action/dist/index.js

0 commit comments

Comments
 (0)