mirror of
https://github.com/github/codeql-action.git
synced 2025-12-06 07:48:17 +08:00
Merge pull request #3249 from github/henrymercer/api-logging
Use Actions logger in API client
This commit is contained in:
1563
lib/analyze-action-post.js
generated
1563
lib/analyze-action-post.js
generated
File diff suppressed because it is too large
Load Diff
1145
lib/analyze-action.js
generated
1145
lib/analyze-action.js
generated
File diff suppressed because it is too large
Load Diff
1087
lib/autobuild-action.js
generated
1087
lib/autobuild-action.js
generated
File diff suppressed because it is too large
Load Diff
1597
lib/init-action-post.js
generated
1597
lib/init-action-post.js
generated
File diff suppressed because it is too large
Load Diff
1137
lib/init-action.js
generated
1137
lib/init-action.js
generated
File diff suppressed because it is too large
Load Diff
1095
lib/resolve-environment-action.js
generated
1095
lib/resolve-environment-action.js
generated
File diff suppressed because it is too large
Load Diff
1099
lib/setup-codeql-action.js
generated
1099
lib/setup-codeql-action.js
generated
File diff suppressed because it is too large
Load Diff
1535
lib/start-proxy-action-post.js
generated
1535
lib/start-proxy-action-post.js
generated
File diff suppressed because it is too large
Load Diff
1583
lib/start-proxy-action.js
generated
1583
lib/start-proxy-action.js
generated
File diff suppressed because it is too large
Load Diff
1071
lib/upload-lib.js
generated
1071
lib/upload-lib.js
generated
File diff suppressed because it is too large
Load Diff
1535
lib/upload-sarif-action-post.js
generated
1535
lib/upload-sarif-action-post.js
generated
File diff suppressed because it is too large
Load Diff
1103
lib/upload-sarif-action.js
generated
1103
lib/upload-sarif-action.js
generated
File diff suppressed because it is too large
Load Diff
2
package-lock.json
generated
2
package-lock.json
generated
@@ -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
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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