Send the version and mode with the user agent
This commit changes the way the action determines if running in action or runner mode. There is now an environment variable that is set at the beginning of the process and elsewhere in the process, we can check to see if the variable is set.
This commit is contained in:
parent
fad7cc482d
commit
47588796b4
48 changed files with 361 additions and 224 deletions
|
|
@ -3,9 +3,12 @@ import * as path from "path";
|
|||
import * as githubUtils from "@actions/github/lib/utils";
|
||||
import consoleLogLevel from "console-log-level";
|
||||
|
||||
import { getRequiredEnvParam, getRequiredInput } from "./actions-util";
|
||||
import { getMode, getRequiredEnvParam, getRequiredInput } from "./actions-util";
|
||||
import { isLocalRun } from "./util";
|
||||
|
||||
// eslint-disable-next-line import/no-commonjs
|
||||
const pkg = require("../package.json");
|
||||
|
||||
export enum DisallowedAPIVersionReason {
|
||||
ACTION_TOO_OLD,
|
||||
ACTION_TOO_NEW,
|
||||
|
|
@ -37,7 +40,7 @@ export const getApiClient = function (
|
|||
return new githubUtils.GitHub(
|
||||
githubUtils.getOctokitOptions(auth, {
|
||||
baseUrl: getApiUrl(apiDetails.url),
|
||||
userAgent: "CodeQL Action",
|
||||
userAgent: `CodeQL ${getMode()}/${pkg.version}`,
|
||||
log: consoleLogLevel({ level: "debug" }),
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue