mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 09:18:47 +00:00
Merge pull request #3249 from github/henrymercer/api-logging
Use Actions logger in API client
This commit is contained in:
Generated
+763
-800
File diff suppressed because it is too large
Load Diff
Generated
+554
-591
File diff suppressed because it is too large
Load Diff
Generated
+525
-562
File diff suppressed because it is too large
Load Diff
Generated
+780
-817
File diff suppressed because it is too large
Load Diff
Generated
+550
-587
File diff suppressed because it is too large
Load Diff
Generated
+529
-566
File diff suppressed because it is too large
Load Diff
Generated
+531
-568
File diff suppressed because it is too large
Load Diff
Generated
+749
-786
File diff suppressed because it is too large
Load Diff
Generated
+773
-810
File diff suppressed because it is too large
Load Diff
Generated
+513
-558
File diff suppressed because it is too large
Load Diff
Generated
+749
-786
File diff suppressed because it is too large
Load Diff
Generated
+533
-570
File diff suppressed because it is too large
Load Diff
Generated
+2
@@ -4508,6 +4508,8 @@
|
||||
},
|
||||
"node_modules/console-log-level": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/console-log-level/-/console-log-level-1.4.1.tgz",
|
||||
"integrity": "sha512-VZzbIORbP+PPcN/gg3DXClTLPLg5Slwd5fL2MIc+o1qZ4BXBvWyc6QxPk6T/Mkr6IVjRpoAGf32XxP3ZWMVRcQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/convert-to-spaces": {
|
||||
|
||||
@@ -9,9 +9,15 @@ if [ "$GITHUB_ACTIONS" = "true" ]; then
|
||||
fi
|
||||
|
||||
# Check if npm install is likely needed before proceeding
|
||||
if [ ! -d node_modules ] || [ package-lock.json -nt node_modules/.package-lock.json ]; then
|
||||
echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated..."
|
||||
if [ ! -d node_modules ]; then
|
||||
echo "Running 'npm install' because 'node_modules' directory is missing."
|
||||
npm install
|
||||
elif [ package.json -nt package-lock.json ]; then
|
||||
echo "Running 'npm install' because 'package-lock.json' appears to be outdated."
|
||||
npm install
|
||||
elif [ package-lock.json -nt node_modules/.package-lock.json ]; then
|
||||
echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated."
|
||||
npm install
|
||||
else
|
||||
echo "Skipping 'npm install' because 'node_modules/.package-lock.json' appears to be up-to-date."
|
||||
echo "Skipping 'npm install' because everything appears to be up-to-date."
|
||||
fi
|
||||
|
||||
+6
-2
@@ -1,7 +1,6 @@
|
||||
import * as core from "@actions/core";
|
||||
import * as githubUtils from "@actions/github/lib/utils";
|
||||
import * as retry from "@octokit/plugin-retry";
|
||||
import consoleLogLevel from "console-log-level";
|
||||
|
||||
import { getActionVersion, getRequiredInput } from "./actions-util";
|
||||
import { Logger } from "./logging";
|
||||
@@ -50,7 +49,12 @@ function createApiClientWithDetails(
|
||||
githubUtils.getOctokitOptions(auth, {
|
||||
baseUrl: apiDetails.apiURL,
|
||||
userAgent: `CodeQL-Action/${getActionVersion()}`,
|
||||
log: consoleLogLevel({ level: "debug" }),
|
||||
log: {
|
||||
debug: core.debug,
|
||||
info: core.info,
|
||||
warn: core.warning,
|
||||
error: core.error,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
+9
-1
@@ -13,7 +13,15 @@ export interface Logger {
|
||||
}
|
||||
|
||||
export function getActionsLogger(): Logger {
|
||||
return core;
|
||||
return {
|
||||
debug: core.debug,
|
||||
info: core.info,
|
||||
warning: core.warning,
|
||||
error: core.error,
|
||||
isDebug: core.isDebug,
|
||||
startGroup: core.startGroup,
|
||||
endGroup: core.endGroup,
|
||||
};
|
||||
}
|
||||
|
||||
export function getRunnerLogger(debugMode: boolean): Logger {
|
||||
|
||||
Reference in New Issue
Block a user