Merge pull request #1736 from github/update-v2.20.1-4385ad556

Merge main into releases/v2
This commit is contained in:
Henry Mercer 2023-06-21 11:54:43 +01:00 committed by GitHub
commit f6e388ebf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
106 changed files with 21324 additions and 23479 deletions

View file

@ -24,10 +24,15 @@ runs:
VERSION="null"
else
VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')"
# Specify 5.7.0, otherwise setup Action will default to latest minor version.
# Specify 5.x.0, otherwise setup Action will default to latest minor version.
if [ $VERSION = "5.7" ]; then
VERSION="5.7.0"
fi
elif [ $VERSION = "5.8" ]; then
VERSION="5.8.0"
# setup-swift does not yet support v5.8.1 Remove this when it does.
elif [ $VERSION = "5.8.1" ]; then
VERSION="5.8.0"
fi
fi
echo "version=$VERSION" | tee -a $GITHUB_OUTPUT

70
.github/workflows/__resolve-environment-action.yml generated vendored Normal file
View file

@ -0,0 +1,70 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# (cd pr-checks; pip install ruamel.yaml && python3 sync.py)
# to regenerate this file.
name: PR Check - Resolve environment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true'
on:
push:
branches:
- main
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
resolve-environment-action:
strategy:
matrix:
include:
- os: ubuntu-latest
version: stable-v2.13.4
- os: macos-latest
version: stable-v2.13.4
- os: windows-latest
version: stable-v2.13.4
name: Resolve environment
permissions:
contents: read
security-events: write
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- name: Set environment variable for Swift enablement
if: >-
runner.os != 'Windows' && (
matrix.version == '20220908' ||
matrix.version == '20221211'
)
shell: bash
run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/resolve-environment
id: resolve-environment
with:
language: go
- name: Fail if no Go configuration was returned
if: (!fromJSON(steps.resolve-environment.outputs.environment).configuration.go)
run: exit 1
env:
CODEQL_ACTION_TEST_MODE: true

View file

@ -1,5 +1,10 @@
# CodeQL Action Changelog
## 2.20.1 - 21 Jun 2023
- Update default CodeQL bundle version to 2.13.4. [#1721](https://github.com/github/codeql-action/pull/1721)
- Experimental: add a new `resolve-environment` action which attempts to infer a configuration for the build environment that is required to build a given project. Do not use this in production as it is part of an internal experiment and subject to change at any time.
## 2.20.0 - 13 Jun 2023
- Bump the version of the Action to 2.20.0. This ensures that users who received a Dependabot upgrade to [`cdcdbb5`](https://github.com/github/codeql-action/commit/cdcdbb579706841c47f7063dda365e292e5cad7a), which was mistakenly marked as Action version 2.13.4, continue to receive updates to the CodeQL Action. Full details in [#1729](https://github.com/github/codeql-action/pull/1729)

10
lib/actions-util.js generated
View file

@ -42,9 +42,9 @@ const pkg = require("../package.json");
*
* This allows us to get stronger type checking of required/optional inputs.
*/
function getRequiredInput(name) {
const getRequiredInput = function (name) {
return core.getInput(name, { required: true });
}
};
exports.getRequiredInput = getRequiredInput;
/**
* Wrapper around core.getInput that converts empty inputs to undefined.
@ -172,7 +172,7 @@ async function getAnalysisKey() {
exports.getAnalysisKey = getAnalysisKey;
async function getAutomationID() {
const analysis_key = await getAnalysisKey();
const environment = getRequiredInput("matrix");
const environment = (0, exports.getRequiredInput)("matrix");
return computeAutomationID(analysis_key, environment);
}
exports.getAutomationID = getAutomationID;
@ -290,6 +290,7 @@ exports.getActionVersion = getActionVersion;
async function createStatusReportBase(actionName, status, actionStartedAt, cause, exception) {
const commitOid = (0, exports.getOptionalInput)("sha") || process.env["GITHUB_SHA"] || "";
const ref = await getRef();
const jobRunUUID = process.env[sharedEnv.JOB_RUN_UUID] || "";
const workflowRunID = (0, workflow_1.getWorkflowRunID)();
const workflowRunAttempt = (0, workflow_1.getWorkflowRunAttempt)();
const workflowName = process.env["GITHUB_WORKFLOW"] || "";
@ -310,6 +311,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
core.exportVariable(sharedEnv.CODEQL_ACTION_TESTING_ENVIRONMENT, testingEnvironment);
}
const statusReport = {
job_run_uuid: jobRunUUID,
workflow_run_id: workflowRunID,
workflow_run_attempt: workflowRunAttempt,
workflow_name: workflowName,
@ -340,7 +342,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
status === "user-error") {
statusReport.completed_at = new Date().toISOString();
}
const matrix = getRequiredInput("matrix");
const matrix = (0, exports.getRequiredInput)("matrix");
if (matrix) {
statusReport.matrix_vars = matrix;
}

File diff suppressed because one or more lines are too long

View file

@ -31,6 +31,7 @@ const path = __importStar(require("path"));
const ava_1 = __importDefault(require("ava"));
const sinon = __importStar(require("sinon"));
const actionsutil = __importStar(require("./actions-util"));
const sharedEnv = __importStar(require("./shared-environment"));
const testing_utils_1 = require("./testing-utils");
const util_1 = require("./util");
(0, testing_utils_1.setupTests)(ava_1.default);
@ -211,4 +212,38 @@ const util_1 = require("./util");
getAdditionalInputStub.restore();
});
});
(0, ava_1.default)("createStatusReportBase", async (t) => {
await (0, util_1.withTmpDir)(async (tmpDir) => {
(0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir);
process.env["GITHUB_REF"] = "refs/heads/main";
process.env["GITHUB_SHA"] = "a".repeat(40);
process.env["GITHUB_RUN_ID"] = "100";
process.env["GITHUB_RUN_ATTEMPT"] = "2";
process.env["GITHUB_REPOSITORY"] = "octocat/HelloWorld";
process.env["CODEQL_ACTION_ANALYSIS_KEY"] = "analysis-key";
process.env["RUNNER_OS"] = "macOS";
const getRequiredInput = sinon.stub(actionsutil, "getRequiredInput");
getRequiredInput.withArgs("matrix").resolves("input/matrix");
const statusReport = await actionsutil.createStatusReportBase("init", "failure", new Date("May 19, 2023 05:19:00"), "failure cause", "exception stack trace");
t.assert(typeof statusReport.job_run_uuid === "string");
t.assert(statusReport.workflow_run_id === 100);
t.assert(statusReport.workflow_run_attempt === 2);
t.assert(statusReport.workflow_name === (process.env["GITHUB_WORKFLOW"] || ""));
t.assert(statusReport.job_name === (process.env["GITHUB_JOB"] || ""));
t.assert(statusReport.analysis_key === "analysis-key");
t.assert(statusReport.commit_oid === process.env["GITHUB_SHA"]);
t.assert(statusReport.ref === process.env["GITHUB_REF"]);
t.assert(statusReport.action_name === "init");
t.assert(statusReport.action_oid === "unknown");
t.assert(statusReport.started_at ===
process.env[sharedEnv.CODEQL_WORKFLOW_STARTED_AT]);
t.assert(statusReport.action_started_at ===
new Date("May 19, 2023 05:19:00").toISOString());
t.assert(statusReport.status === "failure");
t.assert(statusReport.cause === "failure cause");
t.assert(statusReport.exception === "exception stack trace");
t.assert(statusReport.runner_os === process.env["RUNNER_OS"]);
t.assert(typeof statusReport.action_version === "string");
});
});
//# sourceMappingURL=actions-util.test.js.map

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
{ "maximumVersion": "3.10", "minimumVersion": "3.6" }
{ "maximumVersion": "3.10", "minimumVersion": "3.5" }

25
lib/codeql.js generated
View file

@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = exports.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS = exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = exports.CommandInvocationError = void 0;
exports.getExtraOptions = exports.getCodeQLForCmd = exports.getCodeQLForTesting = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.setupCodeQL = exports.CODEQL_VERSION_RESOLVE_ENVIRONMENT = exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = exports.CODEQL_VERSION_ML_POWERED_QUERIES_WINDOWS = exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = exports.CommandInvocationError = void 0;
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
@ -89,6 +89,10 @@ exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = "2.12.1";
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig-file` flag in calls to `database init`.
*/
exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
/**
* Versions 2.13.4+ of the CodeQL CLI support the `resolve build-environment` command.
*/
exports.CODEQL_VERSION_RESOLVE_ENVIRONMENT = "2.13.4";
/**
* Set up CodeQL CLI access.
*
@ -165,6 +169,7 @@ function setCodeQL(partialCodeql) {
resolveLanguages: resolveFunction(partialCodeql, "resolveLanguages"),
betterResolveLanguages: resolveFunction(partialCodeql, "betterResolveLanguages"),
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
resolveBuildEnvironment: resolveFunction(partialCodeql, "resolveBuildEnvironment"),
packDownload: resolveFunction(partialCodeql, "packDownload"),
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
databaseBundle: resolveFunction(partialCodeql, "databaseBundle"),
@ -374,6 +379,24 @@ async function getCodeQLForCmd(cmd, checkVersion) {
throw new Error(`Unexpected output from codeql resolve queries: ${e}`);
}
},
async resolveBuildEnvironment(workingDir, language) {
const codeqlArgs = [
"resolve",
"build-environment",
`--language=${language}`,
...getExtraOptionsFromEnv(["resolve", "build-environment"]),
];
if (workingDir !== undefined) {
codeqlArgs.push("--working-dir", workingDir);
}
const output = await runTool(cmd, codeqlArgs);
try {
return JSON.parse(output);
}
catch (e) {
throw new Error(`Unexpected output from codeql resolve build-environment: ${e} in\n${output}`);
}
},
async databaseRunQueries(databasePath, extraSearchPath, querySuitePath, flags, optimizeForLastQueryRun) {
const codeqlArgs = [
"database",

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-20230524",
"cliVersion": "2.13.3",
"priorBundleVersion": "codeql-bundle-20230428",
"priorCliVersion": "2.13.1"
"bundleVersion": "codeql-bundle-v2.13.4",
"cliVersion": "2.13.4",
"priorBundleVersion": "codeql-bundle-20230524",
"priorCliVersion": "2.13.3"
}

3
lib/init-action.js generated
View file

@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const core = __importStar(require("@actions/core"));
const uuid_1 = require("uuid");
const actions_util_1 = require("./actions-util");
const api_client_1 = require("./api-client");
const feature_flags_1 = require("./feature-flags");
@ -32,6 +33,7 @@ const init_1 = require("./init");
const languages_1 = require("./languages");
const logging_1 = require("./logging");
const repository_1 = require("./repository");
const sharedEnv = __importStar(require("./shared-environment"));
const trap_caching_1 = require("./trap-caching");
const util_1 = require("./util");
const workflow_1 = require("./workflow");
@ -114,6 +116,7 @@ async function run() {
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
const registriesInput = (0, actions_util_1.getOptionalInput)("registries");
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), logger);
core.exportVariable(sharedEnv.JOB_RUN_UUID, (0, uuid_1.v4)());
try {
const workflowErrors = await (0, workflow_1.validateWorkflow)(logger);
if (!(await (0, actions_util_1.sendStatusReport)(await (0, actions_util_1.createStatusReportBase)("init", "starting", startedAt, workflowErrors)))) {

File diff suppressed because one or more lines are too long

82
lib/resolve-environment-action.js generated Normal file
View file

@ -0,0 +1,82 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const actions_util_1 = require("./actions-util");
const api_client_1 = require("./api-client");
const codeql_1 = require("./codeql");
const configUtils = __importStar(require("./config-utils"));
const languages_1 = require("./languages");
const logging_1 = require("./logging");
const resolve_environment_1 = require("./resolve-environment");
const util_1 = require("./util");
const ACTION_NAME = "resolve-environment";
const ENVIRONMENT_OUTPUT_NAME = "environment";
async function run() {
const startedAt = new Date();
const logger = (0, logging_1.getActionsLogger)();
const language = (0, languages_1.resolveAlias)((0, actions_util_1.getRequiredInput)("language"));
try {
if (!(await (0, actions_util_1.sendStatusReport)(await (0, actions_util_1.createStatusReportBase)(ACTION_NAME, "starting", startedAt)))) {
return;
}
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger);
const config = await configUtils.getConfig((0, actions_util_1.getTemporaryDirectory)(), logger);
if (config === undefined) {
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
}
const workingDirectory = (0, actions_util_1.getOptionalInput)("working-directory");
const result = await (0, resolve_environment_1.runResolveBuildEnvironment)(config.codeQLCmd, logger, workingDirectory, language);
core.setOutput(ENVIRONMENT_OUTPUT_NAME, result);
}
catch (unwrappedError) {
const error = (0, util_1.wrapError)(unwrappedError);
if (error instanceof codeql_1.CommandInvocationError) {
// If the CLI failed to run successfully for whatever reason,
// we just return an empty JSON object and proceed with the workflow.
core.setOutput(ENVIRONMENT_OUTPUT_NAME, {});
logger.warning(`Failed to resolve a build environment suitable for automatically building your code. ${error.message}`);
}
else {
// For any other error types, something has more seriously gone wrong and we fail.
core.setFailed(`Failed to resolve a build environment suitable for automatically building your code. ${error.message}`);
await (0, actions_util_1.sendStatusReport)(await (0, actions_util_1.createStatusReportBase)(ACTION_NAME, (0, actions_util_1.getActionsStatus)(error), startedAt, error.message, error.stack));
}
return;
}
await (0, actions_util_1.sendStatusReport)(await (0, actions_util_1.createStatusReportBase)(ACTION_NAME, "success", startedAt));
}
async function runWrapper() {
try {
await run();
}
catch (error) {
core.setFailed(`${ACTION_NAME} action failed: ${(0, util_1.wrapError)(error).message}`);
}
await (0, util_1.checkForTimeout)();
}
void runWrapper();
//# sourceMappingURL=resolve-environment-action.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"resolve-environment-action.js","sourceRoot":"","sources":["../src/resolve-environment-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,iDAOwB;AACxB,6CAAgD;AAChD,qCAAkD;AAClD,4DAA8C;AAC9C,2CAAqD;AACrD,uCAA6C;AAC7C,+DAAmE;AACnE,iCAA+E;AAE/E,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,uBAAuB,GAAG,aAAa,CAAC;AAE9C,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,MAAM,QAAQ,GAAa,IAAA,wBAAY,EAAC,IAAA,+BAAgB,EAAC,UAAU,CAAC,CAAC,CAAC;IAEtE,IAAI;QACF,IACE,CAAC,CAAC,MAAM,IAAA,+BAAgB,EACtB,MAAM,IAAA,qCAAsB,EAAC,WAAW,EAAE,UAAU,EAAE,SAAS,CAAC,CACjE,CAAC,EACF;YACA,OAAO;SACR;QAED,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAgB,GAAE,CAAC;QAC/C,IAAA,gCAAyB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QAEjD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,IAAA,oCAAqB,GAAE,EAAE,MAAM,CAAC,CAAC;QAC5E,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;SACH;QAED,MAAM,gBAAgB,GAAG,IAAA,+BAAgB,EAAC,mBAAmB,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,IAAA,gDAA0B,EAC7C,MAAM,CAAC,SAAS,EAChB,MAAM,EACN,gBAAgB,EAChB,QAAQ,CACT,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;KACjD;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QAExC,IAAI,KAAK,YAAY,+BAAsB,EAAE;YAC3C,6DAA6D;YAC7D,qEAAqE;YACrE,IAAI,CAAC,SAAS,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC;YAC5C,MAAM,CAAC,OAAO,CACZ,wFAAwF,KAAK,CAAC,OAAO,EAAE,CACxG,CAAC;SACH;aAAM;YACL,kFAAkF;YAClF,IAAI,CAAC,SAAS,CACZ,wFAAwF,KAAK,CAAC,OAAO,EAAE,CACxG,CAAC;YAEF,MAAM,IAAA,+BAAgB,EACpB,MAAM,IAAA,qCAAsB,EAC1B,WAAW,EACX,IAAA,+BAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,KAAK,CAAC,OAAO,EACb,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;SACH;QAED,OAAO;KACR;IAED,MAAM,IAAA,+BAAgB,EACpB,MAAM,IAAA,qCAAsB,EAAC,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAChE,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,GAAG,WAAW,mBAAmB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC7E;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

49
lib/resolve-environment.js generated Normal file
View file

@ -0,0 +1,49 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.runResolveBuildEnvironment = void 0;
const codeql_1 = require("./codeql");
const util = __importStar(require("./util"));
async function runResolveBuildEnvironment(cmd, logger, workingDir, language) {
logger.startGroup(`Attempting to resolve build environment for ${language}`);
const codeql = await (0, codeql_1.getCodeQL)(cmd);
let result = {};
// If the CodeQL version in use does not support the `resolve build-environment`
// command, just return an empty configuration. Otherwise invoke the CLI.
if (!(await util.codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_RESOLVE_ENVIRONMENT))) {
logger.warning("Unsupported CodeQL CLI version for `resolve build-environment` command, " +
"returning an empty configuration.");
}
else {
if (workingDir !== undefined) {
logger.info(`Using ${workingDir} as the working directory.`);
}
result = await codeql.resolveBuildEnvironment(workingDir, language);
}
logger.endGroup();
return result;
}
exports.runResolveBuildEnvironment = runResolveBuildEnvironment;
//# sourceMappingURL=resolve-environment.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"resolve-environment.js","sourceRoot":"","sources":["../src/resolve-environment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyE;AAGzE,6CAA+B;AAExB,KAAK,UAAU,0BAA0B,CAC9C,GAAW,EACX,MAAc,EACd,UAA8B,EAC9B,QAAkB;IAElB,MAAM,CAAC,UAAU,CAAC,+CAA+C,QAAQ,EAAE,CAAC,CAAC;IAE7E,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,GAAG,CAAC,CAAC;IACpC,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,gFAAgF;IAChF,yEAAyE;IACzE,IACE,CAAC,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,2CAAkC,CAAC,CAAC,EAC5E;QACA,MAAM,CAAC,OAAO,CACZ,0EAA0E;YACxE,mCAAmC,CACtC,CAAC;KACH;SAAM;QACL,IAAI,UAAU,KAAK,SAAS,EAAE;YAC5B,MAAM,CAAC,IAAI,CAAC,SAAS,UAAU,4BAA4B,CAAC,CAAC;SAC9D;QAED,MAAM,GAAG,MAAM,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;KACrE;IAED,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,MAAM,CAAC;AAChB,CAAC;AA9BD,gEA8BC"}

View file

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ODASA_TRACER_CONFIGURATION = exports.CODEQL_WORKFLOW_STARTED_AT = exports.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX = exports.CODEQL_ACTION_TEST_MODE = exports.CODEQL_ACTION_TESTING_ENVIRONMENT = exports.CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY = exports.CODEQL_ACTION_DID_AUTOBUILD_GOLANG = exports.EnvVar = void 0;
exports.JOB_RUN_UUID = exports.ODASA_TRACER_CONFIGURATION = exports.CODEQL_WORKFLOW_STARTED_AT = exports.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX = exports.CODEQL_ACTION_TEST_MODE = exports.CODEQL_ACTION_TESTING_ENVIRONMENT = exports.CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY = exports.CODEQL_ACTION_DID_AUTOBUILD_GOLANG = exports.EnvVar = void 0;
/**
* Environment variables to be set by codeql-action and used by the
* CLI.
@ -60,4 +60,6 @@ exports.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX = "CODEQL_ACTION_DISABLE_DU
*/
exports.CODEQL_WORKFLOW_STARTED_AT = "CODEQL_WORKFLOW_STARTED_AT";
exports.ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION";
/** UUID representing the current job run. */
exports.JOB_RUN_UUID = "JOB_RUN_UUID";
//# sourceMappingURL=shared-environment.js.map

View file

@ -1 +1 @@
{"version":3,"file":"shared-environment.js","sourceRoot":"","sources":["../src/shared-environment.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,MA8BX;AA9BD,WAAY,MAAM;IAChB;;OAEG;IACH,2CAAiC,CAAA;IAEjC;;;OAGG;IACH,uEAA6D,CAAA;IAE7D;;;OAGG;IACH,mEAAyD,CAAA;IAEzD;;;;OAIG;IACH,yEAA+D,CAAA;IAE/D;;;OAGG;IACH,6DAAmD,CAAA;AACrD,CAAC,EA9BW,MAAM,GAAN,cAAM,KAAN,cAAM,QA8BjB;AAED;;;GAGG;AACU,QAAA,kCAAkC,GAC7C,oCAAoC,CAAC;AAEvC;;;GAGG;AACU,QAAA,+CAA+C,GAC1D,iDAAiD,CAAC;AAEvC,QAAA,iCAAiC,GAC5C,mCAAmC,CAAC;AAEtC,kFAAkF;AACrE,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE;;;GAGG;AACU,QAAA,4CAA4C,GACvD,8CAA8C,CAAC;AAEjD;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAE1D,QAAA,0BAA0B,GAAG,4BAA4B,CAAC"}
{"version":3,"file":"shared-environment.js","sourceRoot":"","sources":["../src/shared-environment.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,MA8BX;AA9BD,WAAY,MAAM;IAChB;;OAEG;IACH,2CAAiC,CAAA;IAEjC;;;OAGG;IACH,uEAA6D,CAAA;IAE7D;;;OAGG;IACH,mEAAyD,CAAA;IAEzD;;;;OAIG;IACH,yEAA+D,CAAA;IAE/D;;;OAGG;IACH,6DAAmD,CAAA;AACrD,CAAC,EA9BW,MAAM,GAAN,cAAM,KAAN,cAAM,QA8BjB;AAED;;;GAGG;AACU,QAAA,kCAAkC,GAC7C,oCAAoC,CAAC;AAEvC;;;GAGG;AACU,QAAA,+CAA+C,GAC1D,iDAAiD,CAAC;AAEvC,QAAA,iCAAiC,GAC5C,mCAAmC,CAAC;AAEtC,kFAAkF;AACrE,QAAA,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE;;;GAGG;AACU,QAAA,4CAA4C,GACvD,8CAA8C,CAAC;AAEjD;;;;;;GAMG;AACU,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAE1D,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,6CAA6C;AAChC,QAAA,YAAY,GAAG,cAAc,CAAC"}

21
lib/upload-lib.js generated
View file

@ -359,16 +359,21 @@ function handleProcessingResultForUnsuccessfulExecution(response, status, logger
response.data.errors.length === 1 &&
response.data.errors[0].toString().startsWith("unsuccessful execution")) {
logger.debug("Successfully uploaded a SARIF file for the unsuccessful execution. Received expected " +
'"unsuccessful execution" error, and no other errors.');
'"unsuccessful execution" processing error, and no other errors.');
}
else if (status === "failed") {
logger.warning(`Failed to upload a SARIF file for the unsuccessful execution. Code scanning status ` +
`information for the repository may be out of date as a result. Processing errors: ${response.data.errors}`);
}
else if (status === "complete") {
// There is a known transient issue with the code scanning API where it sometimes reports
// `complete` for an unsuccessful execution submission.
logger.debug("Uploaded a SARIF file for the unsuccessful execution, but did not receive the expected " +
'"unsuccessful execution" processing error. This is a known transient issue with the ' +
"code scanning API, and does not cause out of date code scanning status information.");
}
else {
const shortMessage = "Failed to upload a SARIF file for the unsuccessful execution. Code scanning status " +
"information for the repository may be out of date as a result.";
const longMessage = shortMessage + status === "failed"
? ` Processing errors: ${response.data.errors}`
: ' Encountered no processing errors, but expected to receive an "unsuccessful execution" error.';
logger.debug(longMessage);
throw new Error(shortMessage);
util.assertNever(status);
}
}
function validateUniqueCategory(sarif) {

File diff suppressed because one or more lines are too long

32
node_modules/.package-lock.json generated vendored
View file

@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "2.20.0",
"version": "2.20.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
@ -557,9 +557,9 @@
}
},
"node_modules/@octokit/openapi-types": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-16.0.0.tgz",
"integrity": "sha512-JbFWOqTJVLHZSUUoF4FzAZKYtqdxWu9Z5m2QQnOyEa04fOFljvyh7D3GYKbfuaSWisqehImiVIMG4eyJeP5VEA=="
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw=="
},
"node_modules/@octokit/plugin-paginate-rest": {
"version": "2.4.0",
@ -596,20 +596,28 @@
}
},
"node_modules/@octokit/plugin-retry": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-4.0.4.tgz",
"integrity": "sha512-d7qGFLR3AH+WbNEDUvBPgMc7wRCxU40FZyNXFFqs8ISw75ZYS5/P3ScggzU13dCoY0aywYDxKugGstQTwNgppA==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-5.0.2.tgz",
"integrity": "sha512-/Z7rWLCfjwmaVdyFuMkZoAnhfrvYgtvDrbO2d6lv7XrvJa8gFGB5tLUMngfuyMBfDCc5B9+EVu7IkQx5ebVlMg==",
"dependencies": {
"@octokit/types": "^9.0.0",
"bottleneck": "^2.15.3"
},
"engines": {
"node": ">= 14"
"node": ">= 18"
},
"peerDependencies": {
"@octokit/core": ">=3"
}
},
"node_modules/@octokit/plugin-retry/node_modules/@octokit/types": {
"version": "9.3.2",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz",
"integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==",
"dependencies": {
"@octokit/openapi-types": "^18.0.0"
}
},
"node_modules/@octokit/request": {
"version": "5.4.9",
"integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==",
@ -650,11 +658,11 @@
}
},
"node_modules/@octokit/types": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.0.0.tgz",
"integrity": "sha512-LUewfj94xCMH2rbD5YJ+6AQ4AVjFYTgpp6rboWM5T7N3IsIF65SBEOVcYMGAEzO/kKNiNaW4LoWtoThOhH06gw==",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-10.0.0.tgz",
"integrity": "sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==",
"dependencies": {
"@octokit/openapi-types": "^16.0.0"
"@octokit/openapi-types": "^18.0.0"
}
},
"node_modules/@opentelemetry/api": {

View file

@ -9,12 +9,12 @@
"publishConfig": {
"access": "public"
},
"version": "16.0.0",
"version": "18.0.0",
"main": "",
"types": "types.d.ts",
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"octokit": {
"openapi-version": "10.0.0"
"openapi-version": "12.0.0"
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,63 +1,107 @@
'use strict';
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
Object.defineProperty(exports, '__esModule', { value: true });
// pkg/dist-src/index.js
var dist_src_exports = {};
__export(dist_src_exports, {
VERSION: () => VERSION,
retry: () => retry
});
module.exports = __toCommonJS(dist_src_exports);
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var Bottleneck = _interopDefault(require('bottleneck/light'));
// @ts-ignore
async function errorRequest(octokit, state, error, options) {
// pkg/dist-src/error-request.js
async function errorRequest(state, octokit, error, options) {
if (!error.request || !error.request.request) {
// address https://github.com/octokit/plugin-retry.js/issues/8
throw error;
}
// retry all >= 400 && not doNotRetry
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
}
// Maybe eventually there will be more cases here
throw error;
}
// @ts-ignore
// @ts-ignore
async function wrapRequest(state, request, options) {
const limiter = new Bottleneck();
// @ts-ignore
limiter.on("failed", function (error, info) {
// pkg/dist-src/wrap-request.js
var import_light = __toESM(require("bottleneck/light"));
var import_request_error = require("@octokit/request-error");
async function wrapRequest(state, octokit, request, options) {
const limiter = new import_light.default();
limiter.on("failed", function(error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
// Returning a number instructs the limiter to retry
// the request after that number of milliseconds have passed
return after * state.retryAfterBaseValue;
}
});
return limiter.schedule(request, options);
return limiter.schedule(
requestWithGraphqlErrorHandling.bind(null, state, octokit, request),
options
);
}
async function requestWithGraphqlErrorHandling(state, octokit, request, options) {
const response = await request(request, options);
if (response.data && response.data.errors && /Something went wrong while executing your query/.test(
response.data.errors[0].message
)) {
const error = new import_request_error.RequestError(response.data.errors[0].message, 500, {
request: options,
response
});
return errorRequest(state, octokit, error, options);
}
return response;
}
const VERSION = "4.0.4";
// pkg/dist-src/index.js
var VERSION = "5.0.2";
function retry(octokit, octokitOptions) {
const state = Object.assign({
enabled: true,
retryAfterBaseValue: 1000,
doNotRetry: [400, 401, 403, 404, 422],
retries: 3
}, octokitOptions.retry);
const state = Object.assign(
{
enabled: true,
retryAfterBaseValue: 1e3,
doNotRetry: [400, 401, 403, 404, 422],
retries: 3
},
octokitOptions.retry
);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
octokit.hook.wrap("request", wrapRequest.bind(null, state));
octokit.hook.error("request", errorRequest.bind(null, state, octokit));
octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit));
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
retries: retries,
retryAfter: retryAfter
retries,
retryAfter
});
return error;
}
@ -65,7 +109,8 @@ function retry(octokit, octokitOptions) {
};
}
retry.VERSION = VERSION;
exports.VERSION = VERSION;
exports.retry = retry;
//# sourceMappingURL=index.js.map
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
VERSION,
retry
});

View file

@ -1 +1,7 @@
{"version":3,"file":"index.js","sources":["../dist-src/error-request.js","../dist-src/wrap-request.js","../dist-src/index.js"],"sourcesContent":["// @ts-ignore\nexport async function errorRequest(octokit, state, error, options) {\n if (!error.request || !error.request.request) {\n // address https://github.com/octokit/plugin-retry.js/issues/8\n throw error;\n }\n // retry all >= 400 && not doNotRetry\n if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {\n const retries = options.request.retries != null ? options.request.retries : state.retries;\n const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);\n throw octokit.retry.retryRequest(error, retries, retryAfter);\n }\n // Maybe eventually there will be more cases here\n throw error;\n}\n","// @ts-ignore\nimport Bottleneck from \"bottleneck/light\";\n// @ts-ignore\nexport async function wrapRequest(state, request, options) {\n const limiter = new Bottleneck();\n // @ts-ignore\n limiter.on(\"failed\", function (error, info) {\n const maxRetries = ~~error.request.request.retries;\n const after = ~~error.request.request.retryAfter;\n options.request.retryCount = info.retryCount + 1;\n if (maxRetries > info.retryCount) {\n // Returning a number instructs the limiter to retry\n // the request after that number of milliseconds have passed\n return after * state.retryAfterBaseValue;\n }\n });\n return limiter.schedule(request, options);\n}\n","import { errorRequest } from \"./error-request\";\nimport { wrapRequest } from \"./wrap-request\";\nexport const VERSION = \"4.0.4\";\nexport function retry(octokit, octokitOptions) {\n const state = Object.assign({\n enabled: true,\n retryAfterBaseValue: 1000,\n doNotRetry: [400, 401, 403, 404, 422],\n retries: 3,\n }, octokitOptions.retry);\n if (state.enabled) {\n octokit.hook.error(\"request\", errorRequest.bind(null, octokit, state));\n octokit.hook.wrap(\"request\", wrapRequest.bind(null, state));\n }\n return {\n retry: {\n retryRequest: (error, retries, retryAfter) => {\n error.request.request = Object.assign({}, error.request.request, {\n retries: retries,\n retryAfter: retryAfter,\n });\n return error;\n },\n },\n };\n}\nretry.VERSION = VERSION;\n"],"names":["errorRequest","octokit","state","error","options","request","status","doNotRetry","includes","retries","retryAfter","Math","pow","retryCount","retry","retryRequest","wrapRequest","limiter","Bottleneck","on","info","maxRetries","after","retryAfterBaseValue","schedule","VERSION","octokitOptions","Object","assign","enabled","hook","bind","wrap"],"mappings":";;;;;;;;AAAA;AACO,eAAeA,YAAY,CAACC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAEC,OAAO,EAAE;EAC/D,IAAI,CAACD,KAAK,CAACE,OAAO,IAAI,CAACF,KAAK,CAACE,OAAO,CAACA,OAAO,EAAE;;IAE1C,MAAMF,KAAK;;;EAGf,IAAIA,KAAK,CAACG,MAAM,IAAI,GAAG,IAAI,CAACJ,KAAK,CAACK,UAAU,CAACC,QAAQ,CAACL,KAAK,CAACG,MAAM,CAAC,EAAE;IACjE,MAAMG,OAAO,GAAGL,OAAO,CAACC,OAAO,CAACI,OAAO,IAAI,IAAI,GAAGL,OAAO,CAACC,OAAO,CAACI,OAAO,GAAGP,KAAK,CAACO,OAAO;IACzF,MAAMC,UAAU,GAAGC,IAAI,CAACC,GAAG,CAAC,CAACR,OAAO,CAACC,OAAO,CAACQ,UAAU,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrE,MAAMZ,OAAO,CAACa,KAAK,CAACC,YAAY,CAACZ,KAAK,EAAEM,OAAO,EAAEC,UAAU,CAAC;;;EAGhE,MAAMP,KAAK;AACf;;ACdA;AACA,AACA;AACA,AAAO,eAAea,WAAW,CAACd,KAAK,EAAEG,OAAO,EAAED,OAAO,EAAE;EACvD,MAAMa,OAAO,GAAG,IAAIC,UAAU,EAAE;;EAEhCD,OAAO,CAACE,EAAE,CAAC,QAAQ,EAAE,UAAUhB,KAAK,EAAEiB,IAAI,EAAE;IACxC,MAAMC,UAAU,GAAG,CAAC,CAAClB,KAAK,CAACE,OAAO,CAACA,OAAO,CAACI,OAAO;IAClD,MAAMa,KAAK,GAAG,CAAC,CAACnB,KAAK,CAACE,OAAO,CAACA,OAAO,CAACK,UAAU;IAChDN,OAAO,CAACC,OAAO,CAACQ,UAAU,GAAGO,IAAI,CAACP,UAAU,GAAG,CAAC;IAChD,IAAIQ,UAAU,GAAGD,IAAI,CAACP,UAAU,EAAE;;;MAG9B,OAAOS,KAAK,GAAGpB,KAAK,CAACqB,mBAAmB;;GAE/C,CAAC;EACF,OAAON,OAAO,CAACO,QAAQ,CAACnB,OAAO,EAAED,OAAO,CAAC;AAC7C;;MCfaqB,OAAO,GAAG,mBAAmB;AAC1C,AAAO,SAASX,KAAK,CAACb,OAAO,EAAEyB,cAAc,EAAE;EAC3C,MAAMxB,KAAK,GAAGyB,MAAM,CAACC,MAAM,CAAC;IACxBC,OAAO,EAAE,IAAI;IACbN,mBAAmB,EAAE,IAAI;IACzBhB,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACrCE,OAAO,EAAE;GACZ,EAAEiB,cAAc,CAACZ,KAAK,CAAC;EACxB,IAAIZ,KAAK,CAAC2B,OAAO,EAAE;IACf5B,OAAO,CAAC6B,IAAI,CAAC3B,KAAK,CAAC,SAAS,EAAEH,YAAY,CAAC+B,IAAI,CAAC,IAAI,EAAE9B,OAAO,EAAEC,KAAK,CAAC,CAAC;IACtED,OAAO,CAAC6B,IAAI,CAACE,IAAI,CAAC,SAAS,EAAEhB,WAAW,CAACe,IAAI,CAAC,IAAI,EAAE7B,KAAK,CAAC,CAAC;;EAE/D,OAAO;IACHY,KAAK,EAAE;MACHC,YAAY,EAAE,CAACZ,KAAK,EAAEM,OAAO,EAAEC,UAAU,KAAK;QAC1CP,KAAK,CAACE,OAAO,CAACA,OAAO,GAAGsB,MAAM,CAACC,MAAM,CAAC,EAAE,EAAEzB,KAAK,CAACE,OAAO,CAACA,OAAO,EAAE;UAC7DI,OAAO,EAAEA,OAAO;UAChBC,UAAU,EAAEA;SACf,CAAC;QACF,OAAOP,KAAK;;;GAGvB;AACL;AACAW,KAAK,CAACW,OAAO,GAAGA,OAAO;;;;;"}
{
"version": 3,
"sources": ["../dist-src/index.js", "../dist-src/error-request.js", "../dist-src/wrap-request.js"],
"sourcesContent": ["import { errorRequest } from \"./error-request\";\nimport { wrapRequest } from \"./wrap-request\";\nconst VERSION = \"5.0.2\";\nfunction retry(octokit, octokitOptions) {\n const state = Object.assign(\n {\n enabled: true,\n retryAfterBaseValue: 1e3,\n doNotRetry: [400, 401, 403, 404, 422],\n retries: 3\n },\n octokitOptions.retry\n );\n if (state.enabled) {\n octokit.hook.error(\"request\", errorRequest.bind(null, state, octokit));\n octokit.hook.wrap(\"request\", wrapRequest.bind(null, state, octokit));\n }\n return {\n retry: {\n retryRequest: (error, retries, retryAfter) => {\n error.request.request = Object.assign({}, error.request.request, {\n retries,\n retryAfter\n });\n return error;\n }\n }\n };\n}\nretry.VERSION = VERSION;\nexport {\n VERSION,\n retry\n};\n", "async function errorRequest(state, octokit, error, options) {\n if (!error.request || !error.request.request) {\n throw error;\n }\n if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {\n const retries = options.request.retries != null ? options.request.retries : state.retries;\n const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);\n throw octokit.retry.retryRequest(error, retries, retryAfter);\n }\n throw error;\n}\nexport {\n errorRequest\n};\n", "import Bottleneck from \"bottleneck/light\";\nimport { RequestError } from \"@octokit/request-error\";\nimport { errorRequest } from \"./error-request\";\nasync function wrapRequest(state, octokit, request, options) {\n const limiter = new Bottleneck();\n limiter.on(\"failed\", function(error, info) {\n const maxRetries = ~~error.request.request.retries;\n const after = ~~error.request.request.retryAfter;\n options.request.retryCount = info.retryCount + 1;\n if (maxRetries > info.retryCount) {\n return after * state.retryAfterBaseValue;\n }\n });\n return limiter.schedule(\n requestWithGraphqlErrorHandling.bind(null, state, octokit, request),\n options\n );\n}\nasync function requestWithGraphqlErrorHandling(state, octokit, request, options) {\n const response = await request(request, options);\n if (response.data && response.data.errors && /Something went wrong while executing your query/.test(\n response.data.errors[0].message\n )) {\n const error = new RequestError(response.data.errors[0].message, 500, {\n request: options,\n response\n });\n return errorRequest(state, octokit, error, options);\n }\n return response;\n}\nexport {\n wrapRequest\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,eAAe,aAAa,OAAO,SAAS,OAAO,SAAS;AAC1D,MAAI,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,SAAS;AAC5C,UAAM;AAAA,EACR;AACA,MAAI,MAAM,UAAU,OAAO,CAAC,MAAM,WAAW,SAAS,MAAM,MAAM,GAAG;AACnE,UAAM,UAAU,QAAQ,QAAQ,WAAW,OAAO,QAAQ,QAAQ,UAAU,MAAM;AAClF,UAAM,aAAa,KAAK,KAAK,QAAQ,QAAQ,cAAc,KAAK,GAAG,CAAC;AACpE,UAAM,QAAQ,MAAM,aAAa,OAAO,SAAS,UAAU;AAAA,EAC7D;AACA,QAAM;AACR;;;ACVA,mBAAuB;AACvB,2BAA6B;AAE7B,eAAe,YAAY,OAAO,SAAS,SAAS,SAAS;AAC3D,QAAM,UAAU,IAAI,aAAAA,QAAW;AAC/B,UAAQ,GAAG,UAAU,SAAS,OAAO,MAAM;AACzC,UAAM,aAAa,CAAC,CAAC,MAAM,QAAQ,QAAQ;AAC3C,UAAM,QAAQ,CAAC,CAAC,MAAM,QAAQ,QAAQ;AACtC,YAAQ,QAAQ,aAAa,KAAK,aAAa;AAC/C,QAAI,aAAa,KAAK,YAAY;AAChC,aAAO,QAAQ,MAAM;AAAA,IACvB;AAAA,EACF,CAAC;AACD,SAAO,QAAQ;AAAA,IACb,gCAAgC,KAAK,MAAM,OAAO,SAAS,OAAO;AAAA,IAClE;AAAA,EACF;AACF;AACA,eAAe,gCAAgC,OAAO,SAAS,SAAS,SAAS;AAC/E,QAAM,WAAW,MAAM,QAAQ,SAAS,OAAO;AAC/C,MAAI,SAAS,QAAQ,SAAS,KAAK,UAAU,kDAAkD;AAAA,IAC7F,SAAS,KAAK,OAAO,CAAC,EAAE;AAAA,EAC1B,GAAG;AACD,UAAM,QAAQ,IAAI,kCAAa,SAAS,KAAK,OAAO,CAAC,EAAE,SAAS,KAAK;AAAA,MACnE,SAAS;AAAA,MACT;AAAA,IACF,CAAC;AACD,WAAO,aAAa,OAAO,SAAS,OAAO,OAAO;AAAA,EACpD;AACA,SAAO;AACT;;;AF5BA,IAAM,UAAU;AAChB,SAAS,MAAM,SAAS,gBAAgB;AACtC,QAAM,QAAQ,OAAO;AAAA,IACnB;AAAA,MACE,SAAS;AAAA,MACT,qBAAqB;AAAA,MACrB,YAAY,CAAC,KAAK,KAAK,KAAK,KAAK,GAAG;AAAA,MACpC,SAAS;AAAA,IACX;AAAA,IACA,eAAe;AAAA,EACjB;AACA,MAAI,MAAM,SAAS;AACjB,YAAQ,KAAK,MAAM,WAAW,aAAa,KAAK,MAAM,OAAO,OAAO,CAAC;AACrE,YAAQ,KAAK,KAAK,WAAW,YAAY,KAAK,MAAM,OAAO,OAAO,CAAC;AAAA,EACrE;AACA,SAAO;AAAA,IACL,OAAO;AAAA,MACL,cAAc,CAAC,OAAO,SAAS,eAAe;AAC5C,cAAM,QAAQ,UAAU,OAAO,OAAO,CAAC,GAAG,MAAM,QAAQ,SAAS;AAAA,UAC/D;AAAA,UACA;AAAA,QACF,CAAC;AACD,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AACA,MAAM,UAAU;",
"names": ["Bottleneck"]
}

View file

@ -1,15 +1,14 @@
// @ts-ignore
export async function errorRequest(octokit, state, error, options) {
if (!error.request || !error.request.request) {
// address https://github.com/octokit/plugin-retry.js/issues/8
throw error;
}
// retry all >= 400 && not doNotRetry
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
}
// Maybe eventually there will be more cases here
async function errorRequest(state, octokit, error, options) {
if (!error.request || !error.request.request) {
throw error;
}
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
}
throw error;
}
export {
errorRequest
};

View file

@ -1,27 +1,34 @@
import { errorRequest } from "./error-request";
import { wrapRequest } from "./wrap-request";
export const VERSION = "0.0.0-development";
export function retry(octokit, octokitOptions) {
const state = Object.assign({
enabled: true,
retryAfterBaseValue: 1000,
doNotRetry: [400, 401, 403, 404, 422],
retries: 3,
}, octokitOptions.retry);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
octokit.hook.wrap("request", wrapRequest.bind(null, state));
const VERSION = "0.0.0-development";
function retry(octokit, octokitOptions) {
const state = Object.assign(
{
enabled: true,
retryAfterBaseValue: 1e3,
doNotRetry: [400, 401, 403, 404, 422],
retries: 3
},
octokitOptions.retry
);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, state, octokit));
octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit));
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
retries,
retryAfter
});
return error;
}
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
retries: retries,
retryAfter: retryAfter,
});
return error;
},
},
};
};
}
retry.VERSION = VERSION;
export {
VERSION,
retry
};

View file

@ -1 +1,4 @@
export const VERSION = "4.0.4";
const VERSION = "5.0.2";
export {
VERSION
};

View file

@ -1,18 +1,34 @@
// @ts-ignore
import Bottleneck from "bottleneck/light";
// @ts-ignore
export async function wrapRequest(state, request, options) {
const limiter = new Bottleneck();
// @ts-ignore
limiter.on("failed", function (error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
// Returning a number instructs the limiter to retry
// the request after that number of milliseconds have passed
return after * state.retryAfterBaseValue;
}
});
return limiter.schedule(request, options);
import { RequestError } from "@octokit/request-error";
import { errorRequest } from "./error-request";
async function wrapRequest(state, octokit, request, options) {
const limiter = new Bottleneck();
limiter.on("failed", function(error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
return after * state.retryAfterBaseValue;
}
});
return limiter.schedule(
requestWithGraphqlErrorHandling.bind(null, state, octokit, request),
options
);
}
async function requestWithGraphqlErrorHandling(state, octokit, request, options) {
const response = await request(request, options);
if (response.data && response.data.errors && /Something went wrong while executing your query/.test(
response.data.errors[0].message
)) {
const error = new RequestError(response.data.errors[0].message, 500, {
request: options,
response
});
return errorRequest(state, octokit, error, options);
}
return response;
}
export {
wrapRequest
};

View file

@ -1 +1 @@
export declare function errorRequest(octokit: any, state: any, error: any, options: any): Promise<void>;
export declare function errorRequest(state: any, octokit: any, error: any, options: any): Promise<void>;

View file

@ -1,5 +1,5 @@
import { Octokit } from "@octokit/core";
import { RequestError } from "@octokit/request-error";
import type { RequestError } from "@octokit/request-error";
export declare const VERSION = "0.0.0-development";
export declare function retry(octokit: Octokit, octokitOptions: any): {
retry: {

View file

@ -1 +1 @@
export declare const VERSION = "4.0.4";
export declare const VERSION = "5.0.2";

View file

@ -1 +1 @@
export declare function wrapRequest(state: any, request: any, options: any): Promise<any>;
export declare function wrapRequest(state: any, octokit: any, request: any, options: any): Promise<any>;

View file

@ -1,64 +1,78 @@
import Bottleneck from 'bottleneck/light';
// @ts-ignore
async function errorRequest(octokit, state, error, options) {
if (!error.request || !error.request.request) {
// address https://github.com/octokit/plugin-retry.js/issues/8
throw error;
}
// retry all >= 400 && not doNotRetry
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
}
// Maybe eventually there will be more cases here
// pkg/dist-src/error-request.js
async function errorRequest(state, octokit, error, options) {
if (!error.request || !error.request.request) {
throw error;
}
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
const retries = options.request.retries != null ? options.request.retries : state.retries;
const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);
throw octokit.retry.retryRequest(error, retries, retryAfter);
}
throw error;
}
// @ts-ignore
// @ts-ignore
async function wrapRequest(state, request, options) {
const limiter = new Bottleneck();
// @ts-ignore
limiter.on("failed", function (error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
// Returning a number instructs the limiter to retry
// the request after that number of milliseconds have passed
return after * state.retryAfterBaseValue;
}
});
return limiter.schedule(request, options);
}
const VERSION = "4.0.4";
function retry(octokit, octokitOptions) {
const state = Object.assign({
enabled: true,
retryAfterBaseValue: 1000,
doNotRetry: [400, 401, 403, 404, 422],
retries: 3,
}, octokitOptions.retry);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, octokit, state));
octokit.hook.wrap("request", wrapRequest.bind(null, state));
// pkg/dist-src/wrap-request.js
import Bottleneck from "bottleneck/light";
import { RequestError } from "@octokit/request-error";
async function wrapRequest(state, octokit, request, options) {
const limiter = new Bottleneck();
limiter.on("failed", function(error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
return after * state.retryAfterBaseValue;
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
retries: retries,
retryAfter: retryAfter,
});
return error;
},
},
};
});
return limiter.schedule(
requestWithGraphqlErrorHandling.bind(null, state, octokit, request),
options
);
}
async function requestWithGraphqlErrorHandling(state, octokit, request, options) {
const response = await request(request, options);
if (response.data && response.data.errors && /Something went wrong while executing your query/.test(
response.data.errors[0].message
)) {
const error = new RequestError(response.data.errors[0].message, 500, {
request: options,
response
});
return errorRequest(state, octokit, error, options);
}
return response;
}
// pkg/dist-src/index.js
var VERSION = "5.0.2";
function retry(octokit, octokitOptions) {
const state = Object.assign(
{
enabled: true,
retryAfterBaseValue: 1e3,
doNotRetry: [400, 401, 403, 404, 422],
retries: 3
},
octokitOptions.retry
);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, state, octokit));
octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit));
}
return {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
retries,
retryAfter
});
return error;
}
}
};
}
retry.VERSION = VERSION;
export { VERSION, retry };
//# sourceMappingURL=index.js.map
export {
VERSION,
retry
};

View file

@ -1 +1,7 @@
{"version":3,"file":"index.js","sources":["../dist-src/error-request.js","../dist-src/wrap-request.js","../dist-src/index.js"],"sourcesContent":["// @ts-ignore\nexport async function errorRequest(octokit, state, error, options) {\n if (!error.request || !error.request.request) {\n // address https://github.com/octokit/plugin-retry.js/issues/8\n throw error;\n }\n // retry all >= 400 && not doNotRetry\n if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {\n const retries = options.request.retries != null ? options.request.retries : state.retries;\n const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);\n throw octokit.retry.retryRequest(error, retries, retryAfter);\n }\n // Maybe eventually there will be more cases here\n throw error;\n}\n","// @ts-ignore\nimport Bottleneck from \"bottleneck/light\";\n// @ts-ignore\nexport async function wrapRequest(state, request, options) {\n const limiter = new Bottleneck();\n // @ts-ignore\n limiter.on(\"failed\", function (error, info) {\n const maxRetries = ~~error.request.request.retries;\n const after = ~~error.request.request.retryAfter;\n options.request.retryCount = info.retryCount + 1;\n if (maxRetries > info.retryCount) {\n // Returning a number instructs the limiter to retry\n // the request after that number of milliseconds have passed\n return after * state.retryAfterBaseValue;\n }\n });\n return limiter.schedule(request, options);\n}\n","import { errorRequest } from \"./error-request\";\nimport { wrapRequest } from \"./wrap-request\";\nexport const VERSION = \"4.0.4\";\nexport function retry(octokit, octokitOptions) {\n const state = Object.assign({\n enabled: true,\n retryAfterBaseValue: 1000,\n doNotRetry: [400, 401, 403, 404, 422],\n retries: 3,\n }, octokitOptions.retry);\n if (state.enabled) {\n octokit.hook.error(\"request\", errorRequest.bind(null, octokit, state));\n octokit.hook.wrap(\"request\", wrapRequest.bind(null, state));\n }\n return {\n retry: {\n retryRequest: (error, retries, retryAfter) => {\n error.request.request = Object.assign({}, error.request.request, {\n retries: retries,\n retryAfter: retryAfter,\n });\n return error;\n },\n },\n };\n}\nretry.VERSION = VERSION;\n"],"names":[],"mappings":";;AAAA;AACO,eAAe,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;AACnE,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE;AAClD;AACA,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK;AACL;AACA,IAAI,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACzE,QAAQ,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAClG,QAAQ,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9E,QAAQ,MAAM,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACrE,KAAK;AACL;AACA,IAAI,MAAM,KAAK,CAAC;AAChB;;ACdA;AACA,AACA;AACA,AAAO,eAAe,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE;AAC3D,IAAI,MAAM,OAAO,GAAG,IAAI,UAAU,EAAE,CAAC;AACrC;AACA,IAAI,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,EAAE,IAAI,EAAE;AAChD,QAAQ,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;AAC3D,QAAQ,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;AACzD,QAAQ,OAAO,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;AACzD,QAAQ,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE;AAC1C;AACA;AACA,YAAY,OAAO,KAAK,GAAG,KAAK,CAAC,mBAAmB,CAAC;AACrD,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;;ACfW,MAAC,OAAO,GAAG,mBAAmB,CAAC;AAC3C,AAAO,SAAS,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE;AAC/C,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AAChC,QAAQ,OAAO,EAAE,IAAI;AACrB,QAAQ,mBAAmB,EAAE,IAAI;AACjC,QAAQ,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AAC7C,QAAQ,OAAO,EAAE,CAAC;AAClB,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;AAC7B,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE;AACvB,QAAQ,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAC/E,QAAQ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;AACpE,KAAK;AACL,IAAI,OAAO;AACX,QAAQ,KAAK,EAAE;AACf,YAAY,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,KAAK;AAC1D,gBAAgB,KAAK,CAAC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE;AACjF,oBAAoB,OAAO,EAAE,OAAO;AACpC,oBAAoB,UAAU,EAAE,UAAU;AAC1C,iBAAiB,CAAC,CAAC;AACnB,gBAAgB,OAAO,KAAK,CAAC;AAC7B,aAAa;AACb,SAAS;AACT,KAAK,CAAC;AACN,CAAC;AACD,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;;;;"}
{
"version": 3,
"sources": ["../dist-src/error-request.js", "../dist-src/wrap-request.js", "../dist-src/index.js"],
"sourcesContent": ["async function errorRequest(state, octokit, error, options) {\n if (!error.request || !error.request.request) {\n throw error;\n }\n if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {\n const retries = options.request.retries != null ? options.request.retries : state.retries;\n const retryAfter = Math.pow((options.request.retryCount || 0) + 1, 2);\n throw octokit.retry.retryRequest(error, retries, retryAfter);\n }\n throw error;\n}\nexport {\n errorRequest\n};\n", "import Bottleneck from \"bottleneck/light\";\nimport { RequestError } from \"@octokit/request-error\";\nimport { errorRequest } from \"./error-request\";\nasync function wrapRequest(state, octokit, request, options) {\n const limiter = new Bottleneck();\n limiter.on(\"failed\", function(error, info) {\n const maxRetries = ~~error.request.request.retries;\n const after = ~~error.request.request.retryAfter;\n options.request.retryCount = info.retryCount + 1;\n if (maxRetries > info.retryCount) {\n return after * state.retryAfterBaseValue;\n }\n });\n return limiter.schedule(\n requestWithGraphqlErrorHandling.bind(null, state, octokit, request),\n options\n );\n}\nasync function requestWithGraphqlErrorHandling(state, octokit, request, options) {\n const response = await request(request, options);\n if (response.data && response.data.errors && /Something went wrong while executing your query/.test(\n response.data.errors[0].message\n )) {\n const error = new RequestError(response.data.errors[0].message, 500, {\n request: options,\n response\n });\n return errorRequest(state, octokit, error, options);\n }\n return response;\n}\nexport {\n wrapRequest\n};\n", "import { errorRequest } from \"./error-request\";\nimport { wrapRequest } from \"./wrap-request\";\nconst VERSION = \"5.0.2\";\nfunction retry(octokit, octokitOptions) {\n const state = Object.assign(\n {\n enabled: true,\n retryAfterBaseValue: 1e3,\n doNotRetry: [400, 401, 403, 404, 422],\n retries: 3\n },\n octokitOptions.retry\n );\n if (state.enabled) {\n octokit.hook.error(\"request\", errorRequest.bind(null, state, octokit));\n octokit.hook.wrap(\"request\", wrapRequest.bind(null, state, octokit));\n }\n return {\n retry: {\n retryRequest: (error, retries, retryAfter) => {\n error.request.request = Object.assign({}, error.request.request, {\n retries,\n retryAfter\n });\n return error;\n }\n }\n };\n}\nretry.VERSION = VERSION;\nexport {\n VERSION,\n retry\n};\n"],
"mappings": ";AAAA,eAAe,aAAa,OAAO,SAAS,OAAO,SAAS;AAC1D,MAAI,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,SAAS;AAC5C,UAAM;AAAA,EACR;AACA,MAAI,MAAM,UAAU,OAAO,CAAC,MAAM,WAAW,SAAS,MAAM,MAAM,GAAG;AACnE,UAAM,UAAU,QAAQ,QAAQ,WAAW,OAAO,QAAQ,QAAQ,UAAU,MAAM;AAClF,UAAM,aAAa,KAAK,KAAK,QAAQ,QAAQ,cAAc,KAAK,GAAG,CAAC;AACpE,UAAM,QAAQ,MAAM,aAAa,OAAO,SAAS,UAAU;AAAA,EAC7D;AACA,QAAM;AACR;;;ACVA,OAAO,gBAAgB;AACvB,SAAS,oBAAoB;AAE7B,eAAe,YAAY,OAAO,SAAS,SAAS,SAAS;AAC3D,QAAM,UAAU,IAAI,WAAW;AAC/B,UAAQ,GAAG,UAAU,SAAS,OAAO,MAAM;AACzC,UAAM,aAAa,CAAC,CAAC,MAAM,QAAQ,QAAQ;AAC3C,UAAM,QAAQ,CAAC,CAAC,MAAM,QAAQ,QAAQ;AACtC,YAAQ,QAAQ,aAAa,KAAK,aAAa;AAC/C,QAAI,aAAa,KAAK,YAAY;AAChC,aAAO,QAAQ,MAAM;AAAA,IACvB;AAAA,EACF,CAAC;AACD,SAAO,QAAQ;AAAA,IACb,gCAAgC,KAAK,MAAM,OAAO,SAAS,OAAO;AAAA,IAClE;AAAA,EACF;AACF;AACA,eAAe,gCAAgC,OAAO,SAAS,SAAS,SAAS;AAC/E,QAAM,WAAW,MAAM,QAAQ,SAAS,OAAO;AAC/C,MAAI,SAAS,QAAQ,SAAS,KAAK,UAAU,kDAAkD;AAAA,IAC7F,SAAS,KAAK,OAAO,CAAC,EAAE;AAAA,EAC1B,GAAG;AACD,UAAM,QAAQ,IAAI,aAAa,SAAS,KAAK,OAAO,CAAC,EAAE,SAAS,KAAK;AAAA,MACnE,SAAS;AAAA,MACT;AAAA,IACF,CAAC;AACD,WAAO,aAAa,OAAO,SAAS,OAAO,OAAO;AAAA,EACpD;AACA,SAAO;AACT;;;AC5BA,IAAM,UAAU;AAChB,SAAS,MAAM,SAAS,gBAAgB;AACtC,QAAM,QAAQ,OAAO;AAAA,IACnB;AAAA,MACE,SAAS;AAAA,MACT,qBAAqB;AAAA,MACrB,YAAY,CAAC,KAAK,KAAK,KAAK,KAAK,GAAG;AAAA,MACpC,SAAS;AAAA,IACX;AAAA,IACA,eAAe;AAAA,EACjB;AACA,MAAI,MAAM,SAAS;AACjB,YAAQ,KAAK,MAAM,WAAW,aAAa,KAAK,MAAM,OAAO,OAAO,CAAC;AACrE,YAAQ,KAAK,KAAK,WAAW,YAAY,KAAK,MAAM,OAAO,OAAO,CAAC;AAAA,EACrE;AACA,SAAO;AAAA,IACL,OAAO;AAAA,MACL,cAAc,CAAC,OAAO,SAAS,eAAe;AAC5C,cAAM,QAAQ,UAAU,OAAO,OAAO,CAAC,GAAG,MAAM,QAAQ,SAAS;AAAA,UAC/D;AAAA,UACA;AAAA,QACF,CAAC;AACD,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AACA,MAAM,UAAU;",
"names": []
}

View file

@ -0,0 +1,7 @@
MIT License Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,65 @@
# types.ts
> Shared TypeScript definitions for Octokit projects
[![@latest](https://img.shields.io/npm/v/@octokit/types.svg)](https://www.npmjs.com/package/@octokit/types)
[![Build Status](https://github.com/octokit/types.ts/workflows/Test/badge.svg)](https://github.com/octokit/types.ts/actions?workflow=Test)
<!-- toc -->
- [Usage](#usage)
- [Examples](#examples)
- [Get parameter and response data types for a REST API endpoint](#get-parameter-and-response-data-types-for-a-rest-api-endpoint)
- [Get response types from endpoint methods](#get-response-types-from-endpoint-methods)
- [Contributing](#contributing)
- [License](#license)
<!-- tocstop -->
## Usage
See all exported types at https://octokit.github.io/types.ts
## Examples
### Get parameter and response data types for a REST API endpoint
```ts
import { Endpoints } from "@octokit/types";
type listUserReposParameters =
Endpoints["GET /repos/{owner}/{repo}"]["parameters"];
type listUserReposResponse = Endpoints["GET /repos/{owner}/{repo}"]["response"];
async function listRepos(
options: listUserReposParameters
): listUserReposResponse["data"] {
// ...
}
```
### Get response types from endpoint methods
```ts
import {
GetResponseTypeFromEndpointMethod,
GetResponseDataTypeFromEndpointMethod,
} from "@octokit/types";
import { Octokit } from "@octokit/rest";
const octokit = new Octokit();
type CreateLabelResponseType = GetResponseTypeFromEndpointMethod<
typeof octokit.issues.createLabel
>;
type CreateLabelResponseDataType = GetResponseDataTypeFromEndpointMethod<
typeof octokit.issues.createLabel
>;
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
## License
[MIT](LICENSE)

View file

@ -0,0 +1,31 @@
import { EndpointOptions } from "./EndpointOptions";
import { OctokitResponse } from "./OctokitResponse";
import { RequestInterface } from "./RequestInterface";
import { RequestParameters } from "./RequestParameters";
import { Route } from "./Route";
/**
* Interface to implement complex authentication strategies for Octokit.
* An object Implementing the AuthInterface can directly be passed as the
* `auth` option in the Octokit constructor.
*
* For the official implementations of the most common authentication
* strategies, see https://github.com/octokit/auth.js
*/
export interface AuthInterface<AuthOptions extends any[], Authentication extends any> {
(...args: AuthOptions): Promise<Authentication>;
hook: {
/**
* Sends a request using the passed `request` instance
*
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<T = any>(request: RequestInterface, options: EndpointOptions): Promise<OctokitResponse<T>>;
/**
* Sends a request using the passed `request` instance
*
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<T = any>(request: RequestInterface, route: Route, parameters?: RequestParameters): Promise<OctokitResponse<T>>;
};
}

View file

@ -0,0 +1,21 @@
import { RequestHeaders } from "./RequestHeaders";
import { RequestMethod } from "./RequestMethod";
import { RequestParameters } from "./RequestParameters";
import { Url } from "./Url";
/**
* The `.endpoint()` method is guaranteed to set all keys defined by RequestParameters
* as well as the method property.
*/
export type EndpointDefaults = RequestParameters & {
baseUrl: Url;
method: RequestMethod;
url?: Url;
headers: RequestHeaders & {
accept: string;
"user-agent": string;
};
mediaType: {
format: string;
previews: string[];
};
};

View file

@ -0,0 +1,65 @@
import { EndpointDefaults } from "./EndpointDefaults";
import { RequestOptions } from "./RequestOptions";
import { RequestParameters } from "./RequestParameters";
import { Route } from "./Route";
import { Endpoints } from "./generated/Endpoints";
export interface EndpointInterface<D extends object = object> {
/**
* Transforms a GitHub REST API endpoint into generic request options
*
* @param {object} endpoint Must set `url` unless it's set defaults. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<O extends RequestParameters = RequestParameters>(options: O & {
method?: string;
} & ("url" extends keyof D ? {
url?: string;
} : {
url: string;
})): RequestOptions & Pick<D & O, keyof RequestOptions>;
/**
* Transforms a GitHub REST API endpoint into generic request options
*
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<R extends Route, P extends RequestParameters = R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters>(route: keyof Endpoints | R, parameters?: P): (R extends keyof Endpoints ? Endpoints[R]["request"] : RequestOptions) & Pick<P, keyof RequestOptions>;
/**
* Object with current default route and parameters
*/
DEFAULTS: D & EndpointDefaults;
/**
* Returns a new `endpoint` interface with new defaults
*/
defaults: <O extends RequestParameters = RequestParameters>(newDefaults: O) => EndpointInterface<D & O>;
merge: {
/**
* Merges current endpoint defaults with passed route and parameters,
* without transforming them into request options.
*
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*
*/
<R extends Route, P extends RequestParameters = R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters>(route: keyof Endpoints | R, parameters?: P): D & (R extends keyof Endpoints ? Endpoints[R]["request"] & Endpoints[R]["parameters"] : EndpointDefaults) & P;
/**
* Merges current endpoint defaults with passed route and parameters,
* without transforming them into request options.
*
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<P extends RequestParameters = RequestParameters>(options: P): EndpointDefaults & D & P;
/**
* Returns current default options.
*
* @deprecated use endpoint.DEFAULTS instead
*/
(): D & EndpointDefaults;
};
/**
* Stateless method to turn endpoint options into request options.
* Calling `endpoint(options)` is the same as calling `endpoint.parse(endpoint.merge(options))`.
*
* @param {object} options `method`, `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
parse: <O extends EndpointDefaults = EndpointDefaults>(options: O) => RequestOptions & Pick<O, keyof RequestOptions>;
}

View file

@ -0,0 +1,7 @@
import { RequestMethod } from "./RequestMethod";
import { Url } from "./Url";
import { RequestParameters } from "./RequestParameters";
export type EndpointOptions = RequestParameters & {
method: RequestMethod;
url: Url;
};

View file

@ -0,0 +1,4 @@
/**
* Browser's fetch method (or compatible such as fetch-mock)
*/
export type Fetch = any;

View file

@ -0,0 +1,5 @@
type Unwrap<T> = T extends Promise<infer U> ? U : T;
type AnyFunction = (...args: any[]) => any;
export type GetResponseTypeFromEndpointMethod<T extends AnyFunction> = Unwrap<ReturnType<T>>;
export type GetResponseDataTypeFromEndpointMethod<T extends AnyFunction> = Unwrap<ReturnType<T>>["data"];
export {};

View file

@ -0,0 +1,17 @@
import { ResponseHeaders } from "./ResponseHeaders";
import { Url } from "./Url";
export type OctokitResponse<T, S extends number = number> = {
headers: ResponseHeaders;
/**
* http response code
*/
status: S;
/**
* URL of response after all redirects
*/
url: Url;
/**
* Response data as documented in the REST API reference documentation at https://docs.github.com/rest/reference
*/
data: T;
};

View file

@ -0,0 +1,11 @@
export type RequestError = {
name: string;
status: number;
documentation_url: string;
errors?: Array<{
resource: string;
code: string;
field: string;
message?: string;
}>;
};

View file

@ -0,0 +1,15 @@
export type RequestHeaders = {
/**
* Avoid setting `headers.accept`, use `mediaType.{format|previews}` option instead.
*/
accept?: string;
/**
* Use `authorization` to send authenticated request, remember `token ` / `bearer ` prefixes. Example: `token 1234567890abcdef1234567890abcdef12345678`
*/
authorization?: string;
/**
* `user-agent` is set do a default and can be overwritten as needed.
*/
"user-agent"?: string;
[header: string]: string | number | undefined;
};

View file

@ -0,0 +1,34 @@
import { EndpointInterface } from "./EndpointInterface";
import { OctokitResponse } from "./OctokitResponse";
import { RequestParameters } from "./RequestParameters";
import { Route } from "./Route";
import { Endpoints } from "./generated/Endpoints";
export interface RequestInterface<D extends object = object> {
/**
* Sends a request based on endpoint options
*
* @param {object} endpoint Must set `method` and `url`. Plus URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<T = any, O extends RequestParameters = RequestParameters>(options: O & {
method?: string;
} & ("url" extends keyof D ? {
url?: string;
} : {
url: string;
})): Promise<OctokitResponse<T>>;
/**
* Sends a request based on endpoint options
*
* @param {string} route Request method + URL. Example: `'GET /orgs/{org}'`
* @param {object} [parameters] URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
<R extends Route>(route: keyof Endpoints | R, options?: R extends keyof Endpoints ? Endpoints[R]["parameters"] & RequestParameters : RequestParameters): R extends keyof Endpoints ? Promise<Endpoints[R]["response"]> : Promise<OctokitResponse<any>>;
/**
* Returns a new `request` with updated route and parameters
*/
defaults: <O extends RequestParameters = RequestParameters>(newDefaults: O) => RequestInterface<D & O>;
/**
* Octokit endpoint API, see {@link https://github.com/octokit/endpoint.js|@octokit/endpoint}
*/
endpoint: EndpointInterface<D>;
}

View file

@ -0,0 +1,4 @@
/**
* HTTP Verb supported by GitHub's REST API
*/
export type RequestMethod = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";

View file

@ -0,0 +1,14 @@
import { RequestHeaders } from "./RequestHeaders";
import { RequestMethod } from "./RequestMethod";
import { RequestRequestOptions } from "./RequestRequestOptions";
import { Url } from "./Url";
/**
* Generic request options as they are returned by the `endpoint()` method
*/
export type RequestOptions = {
method: RequestMethod;
url: Url;
headers: RequestHeaders;
body?: any;
request?: RequestRequestOptions;
};

View file

@ -0,0 +1,45 @@
import { RequestRequestOptions } from "./RequestRequestOptions";
import { RequestHeaders } from "./RequestHeaders";
import { Url } from "./Url";
/**
* Parameters that can be passed into `request(route, parameters)` or `endpoint(route, parameters)` methods
*/
export type RequestParameters = {
/**
* Base URL to be used when a relative URL is passed, such as `/orgs/{org}`.
* If `baseUrl` is `https://enterprise.acme-inc.com/api/v3`, then the request
* will be sent to `https://enterprise.acme-inc.com/api/v3/orgs/{org}`.
*/
baseUrl?: Url;
/**
* HTTP headers. Use lowercase keys.
*/
headers?: RequestHeaders;
/**
* Media type options, see {@link https://developer.github.com/v3/media/|GitHub Developer Guide}
*/
mediaType?: {
/**
* `json` by default. Can be `raw`, `text`, `html`, `full`, `diff`, `patch`, `sha`, `base64`. Depending on endpoint
*/
format?: string;
/**
* Custom media type names of {@link https://developer.github.com/v3/media/|API Previews} without the `-preview` suffix.
* Example for single preview: `['squirrel-girl']`.
* Example for multiple previews: `['squirrel-girl', 'mister-fantastic']`.
*/
previews?: string[];
};
/**
* Pass custom meta information for the request. The `request` object will be returned as is.
*/
request?: RequestRequestOptions;
/**
* Any additional parameter will be passed as follows
* 1. URL parameter if `':parameter'` or `{parameter}` is part of `url`
* 2. Query parameter if `method` is `'GET'` or `'HEAD'`
* 3. Request body if `parameter` is `'data'`
* 4. JSON in the request body in the form of `body[parameter]` unless `parameter` key is `'data'`
*/
[parameter: string]: unknown;
};

View file

@ -0,0 +1,26 @@
import { Fetch } from "./Fetch";
import { Signal } from "./Signal";
/**
* Octokit-specific request options which are ignored for the actual request, but can be used by Octokit or plugins to manipulate how the request is sent or how a response is handled
*/
export type RequestRequestOptions = {
/**
* Node only. Useful for custom proxy, certificate, or dns lookup.
*
* @see https://nodejs.org/api/http.html#http_class_http_agent
*/
agent?: unknown;
/**
* Custom replacement for built-in fetch method. Useful for testing or request hooks.
*/
fetch?: Fetch;
/**
* Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests.
*/
signal?: Signal;
/**
* Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). `options.request.signal` is recommended instead.
*/
timeout?: number;
[option: string]: any;
};

View file

@ -0,0 +1,20 @@
export type ResponseHeaders = {
"cache-control"?: string;
"content-length"?: number;
"content-type"?: string;
date?: string;
etag?: string;
"last-modified"?: string;
link?: string;
location?: string;
server?: string;
status?: string;
vary?: string;
"x-github-mediatype"?: string;
"x-github-request-id"?: string;
"x-oauth-scopes"?: string;
"x-ratelimit-limit"?: string;
"x-ratelimit-remaining"?: string;
"x-ratelimit-reset"?: string;
[header: string]: string | number | undefined;
};

View file

@ -0,0 +1,4 @@
/**
* String consisting of an optional HTTP method and relative path or absolute URL. Examples: `'/orgs/{org}'`, `'PUT /orgs/{org}'`, `GET https://example.com/foo/bar`
*/
export type Route = string;

View file

@ -0,0 +1,6 @@
/**
* Abort signal
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
*/
export type Signal = any;

View file

@ -0,0 +1,4 @@
import { AuthInterface } from "./AuthInterface";
export interface StrategyInterface<StrategyOptions extends any[], AuthOptions extends any[], Authentication extends object> {
(...args: StrategyOptions): AuthInterface<AuthOptions, Authentication>;
}

View file

@ -0,0 +1,4 @@
/**
* Relative or absolute URL. Examples: `'/orgs/{org}'`, `https://example.com/foo/bar`
*/
export type Url = string;

View file

@ -0,0 +1 @@
export declare const VERSION = "9.3.2";

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,46 @@
{
"name": "@octokit/types",
"version": "9.3.2",
"publishConfig": {
"access": "public"
},
"description": "Shared TypeScript definitions for Octokit projects",
"dependencies": {
"@octokit/openapi-types": "^18.0.0"
},
"repository": "github:octokit/types.ts",
"keywords": [
"github",
"api",
"sdk",
"toolkit",
"typescript"
],
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"devDependencies": {
"@octokit/tsconfig": "^1.0.2",
"@types/node": ">= 8",
"github-openapi-graphql-query": "^4.0.0",
"handlebars": "^4.7.6",
"json-schema-to-typescript": "^13.0.0",
"lodash.set": "^4.3.2",
"npm-run-all": "^4.1.5",
"pascal-case": "^3.1.1",
"prettier": "^2.0.0",
"semantic-release": "^21.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"sort-keys": "^4.2.0",
"string-to-jsdoc-comment": "^1.0.0",
"typedoc": "^0.24.0",
"typescript": "^5.0.0"
},
"octokit": {
"openapi-version": "12.0.0"
},
"files": [
"dist-types/**"
],
"types": "dist-types/index.d.ts",
"sideEffects": false
}

View file

@ -1,19 +1,13 @@
{
"name": "@octokit/plugin-retry",
"version": "5.0.2",
"publishConfig": {
"access": "public"
},
"description": "Automatic retry plugin for octokit",
"version": "4.0.4",
"license": "MIT",
"files": [
"dist-*/",
"bin/"
],
"source": "dist-src/index.js",
"types": "dist-types/index.d.ts",
"main": "dist-node/index.js",
"module": "dist-web/index.js",
"pika": true,
"sideEffects": false,
"repository": "github:octokit/plugin-retry.js",
"author": "Simon Grondin (http://github.com/SGrondin)",
"license": "MIT",
"dependencies": {
"@octokit/types": "^9.0.0",
"bottleneck": "^2.15.3"
@ -23,25 +17,30 @@
},
"devDependencies": {
"@octokit/core": "^4.0.0",
"@octokit/request-error": "^3.0.0",
"@pika/pack": "^0.3.7",
"@pika/plugin-build-node": "^0.9.0",
"@pika/plugin-build-web": "^0.9.0",
"@pika/plugin-ts-standard-pkg": "^0.9.0",
"@octokit/request-error": "^4.0.0",
"@octokit/tsconfig": "^2.0.0",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^29.0.0",
"@types/node": "^18.0.0",
"esbuild": "^0.17.19",
"fetch-mock": "^9.0.0",
"glob": "^10.2.6",
"jest": "^29.0.0",
"prettier": "2.8.3",
"prettier": "2.8.8",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"ts-jest": "^29.0.0",
"typescript": "^4.0.2"
"typescript": "^5.0.0"
},
"engines": {
"node": ">= 14"
"node": ">= 18"
},
"publishConfig": {
"access": "public"
}
"files": [
"dist-*/**",
"bin/**"
],
"main": "dist-node/index.js",
"browser": "dist-web/index.js",
"types": "dist-types/index.d.ts",
"module": "dist-src/index.js",
"sideEffects": false
}

View file

@ -1,8 +0,0 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const VERSION = "9.0.0";
exports.VERSION = VERSION;
//# sourceMappingURL=index.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"index.js","sources":["../dist-src/VERSION.js"],"sourcesContent":["export const VERSION = \"0.0.0-development\";\n"],"names":["VERSION"],"mappings":";;;;MAAaA,OAAO,GAAG;;;;"}

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export {};

View file

@ -1 +0,0 @@
export const VERSION = "9.0.0";

View file

@ -1 +0,0 @@
export {};

View file

@ -16,6 +16,6 @@ export type EndpointDefaults = RequestParameters & {
};
mediaType: {
format: string;
previews: string[];
previews?: string[];
};
};

View file

@ -24,7 +24,7 @@ export type RequestParameters = {
*/
format?: string;
/**
* Custom media type names of {@link https://developer.github.com/v3/media/|API Previews} without the `-preview` suffix.
* Custom media type names of {@link https://docs.github.com/en/graphql/overview/schema-previews|GraphQL API Previews} without the `-preview` suffix.
* Example for single preview: `['squirrel-girl']`.
* Example for multiple previews: `['squirrel-girl', 'mister-fantastic']`.
*/

View file

@ -1 +1 @@
export declare const VERSION = "9.0.0";
export declare const VERSION = "10.0.0";

View file

@ -4,7 +4,7 @@ import { RequestHeaders } from "../RequestHeaders";
import { RequestRequestOptions } from "../RequestRequestOptions";
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
type ExtractParameters<T> = "parameters" extends keyof T ? UnionToIntersection<{
[K in keyof T["parameters"]]: T["parameters"][K];
[K in keyof T["parameters"]]-?: T["parameters"][K];
}[keyof T["parameters"]]> : {};
type ExtractRequestBody<T> = "requestBody" extends keyof T ? "content" extends keyof T["requestBody"] ? "application/json" extends keyof T["requestBody"]["content"] ? T["requestBody"]["content"]["application/json"] : {
data: {
@ -15,14 +15,9 @@ type ExtractRequestBody<T> = "requestBody" extends keyof T ? "content" extends k
[K in keyof T["requestBody"]]: T["requestBody"][K];
}[keyof T["requestBody"]];
} : {};
type ToOctokitParameters<T> = ExtractParameters<T> & ExtractRequestBody<T>;
type RequiredPreview<T> = T extends string ? {
mediaType: {
previews: [T, ...string[]];
};
} : {};
type Operation<Url extends keyof paths, Method extends keyof paths[Url], preview = unknown> = {
parameters: ToOctokitParameters<paths[Url][Method]> & RequiredPreview<preview>;
type ToOctokitParameters<T> = ExtractParameters<T> & ExtractRequestBody<Required<T>>;
type Operation<Url extends keyof paths, Method extends keyof paths[Url]> = {
parameters: ToOctokitParameters<paths[Url][Method]>;
request: {
method: Method extends keyof MethodsMap ? MethodsMap[Method] : never;
url: Url;
@ -73,14 +68,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/apps#delete-an-app-token
*/
"DELETE /applications/{client_id}/token": Operation<"/applications/{client_id}/token", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-enterprise
*/
"DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#delete-self-hosted-runner-from-an-enterprise
*/
"DELETE /enterprises/{enterprise}/actions/runners/{runner_id}": Operation<"/enterprises/{enterprise}/actions/runners/{runner_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/gists#delete-a-gist
*/
@ -101,6 +88,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/activity#delete-a-thread-subscription
*/
"DELETE /notifications/threads/{thread_id}/subscription": Operation<"/notifications/threads/{thread_id}/subscription", "delete">;
/**
* @see https://docs.github.com/rest/orgs/orgs/#delete-an-organization
*/
"DELETE /orgs/{org}": Operation<"/orgs/{org}", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization
*/
@ -113,18 +104,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/actions#remove-a-repository-from-selected-repositories-list-for-a-required-workflow
*/
"DELETE /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-group-from-an-organization
*/
"DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization
*/
"DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization
*/
"DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/actions#delete-a-self-hosted-runner-from-an-organization
*/
@ -157,6 +136,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/orgs#unblock-a-user-from-an-organization
*/
"DELETE /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "delete">;
/**
* @see https://docs.github.com/rest/reference/codespaces#delete-codespaces-billing-users
*/
"DELETE /orgs/{org}/codespaces/billing/selected_users": Operation<"/orgs/{org}/codespaces/billing/selected_users", "delete">;
/**
* @see https://docs.github.com/rest/reference/codespaces#delete-an-organization-secret
*/
@ -198,11 +181,11 @@ export interface Endpoints {
*/
"DELETE /orgs/{org}/memberships/{username}": Operation<"/orgs/{org}/memberships/{username}", "delete">;
/**
* @see https://docs.github.com/rest/reference/migrations#delete-an-organization-migration-archive
* @see https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive
*/
"DELETE /orgs/{org}/migrations/{migration_id}/archive": Operation<"/orgs/{org}/migrations/{migration_id}/archive", "delete">;
/**
* @see https://docs.github.com/rest/reference/migrations#unlock-an-organization-repository
* @see https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository
*/
"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock": Operation<"/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", "delete">;
/**
@ -221,6 +204,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/orgs#remove-public-organization-membership-for-the-authenticated-user
*/
"DELETE /orgs/{org}/public_members/{username}": Operation<"/orgs/{org}/public_members/{username}", "delete">;
/**
* @see https://docs.github.com/rest/repos/rules#delete-organization-ruleset
*/
"DELETE /orgs/{org}/rulesets/{ruleset_id}": Operation<"/orgs/{org}/rulesets/{ruleset_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/orgs#remove-a-security-manager-team
*/
@ -318,7 +305,7 @@ export interface Endpoints {
*/
"DELETE /repos/{owner}/{repo}/actions/variables/{name}": Operation<"/repos/{owner}/{repo}/actions/variables/{name}", "delete">;
/**
* @see https://docs.github.com/v3/repos#delete-autolink
* @see https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository
*/
"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}": Operation<"/repos/{owner}/{repo}/autolinks/{autolink_id}", "delete">;
/**
@ -405,6 +392,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/branch-policies#delete-deployment-branch-policy
*/
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", "delete">;
/**
* @see https://docs.github.com/rest/deployments/protection-rules#disable-deployment-protection-rule
*/
"DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/git#delete-a-reference
*/
@ -414,7 +405,7 @@ export interface Endpoints {
*/
"DELETE /repos/{owner}/{repo}/hooks/{hook_id}": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/migrations#cancel-an-import
* @see https://docs.github.com/rest/migrations/source-imports#cancel-an-import
*/
"DELETE /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "delete">;
/**
@ -501,6 +492,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/reactions/#delete-a-release-reaction
*/
"DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}": Operation<"/repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}", "delete">;
/**
* @see https://docs.github.com/rest/repos/rules#delete-repository-ruleset
*/
"DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}": Operation<"/repos/{owner}/{repo}/rulesets/{ruleset_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/activity#delete-a-repository-subscription
*/
@ -590,11 +585,11 @@ export interface Endpoints {
*/
"DELETE /user/keys/{key_id}": Operation<"/user/keys/{key_id}", "delete">;
/**
* @see https://docs.github.com/rest/reference/migrations#delete-a-user-migration-archive
* @see https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive
*/
"DELETE /user/migrations/{migration_id}/archive": Operation<"/user/migrations/{migration_id}/archive", "delete">;
/**
* @see https://docs.github.com/rest/reference/migrations#unlock-a-user-repository
* @see https://docs.github.com/rest/migrations/users#unlock-a-user-repository
*/
"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock": Operation<"/user/migrations/{migration_id}/repos/{repo_name}/lock", "delete">;
/**
@ -609,6 +604,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation
*/
"DELETE /user/repository_invitations/{invitation_id}": Operation<"/user/repository_invitations/{invitation_id}", "delete">;
/**
* @see https://docs.github.com/rest/users/social-accounts#delete-social-account-for-authenticated-user
*/
"DELETE /user/social_accounts": Operation<"/user/social_accounts", "delete">;
/**
* @see https://docs.github.com/rest/reference/users#delete-a-ssh-signing-key-for-the-authenticated-user
*/
@ -645,6 +644,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/apps#get-a-delivery-for-an-app-webhook
*/
"GET /app/hook/deliveries/{delivery_id}": Operation<"/app/hook/deliveries/{delivery_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/apps#list-installation-requests-for-the-authenticated-app
*/
"GET /app/installation-requests": Operation<"/app/installation-requests", "get">;
/**
* @see https://docs.github.com/rest/reference/apps#list-installations-for-the-authenticated-app
*/
@ -669,22 +672,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/emojis#get-emojis
*/
"GET /emojis": Operation<"/emojis", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#list-self-hosted-runner-groups-for-an-enterprise
*/
"GET /enterprises/{enterprise}/actions/runner-groups": Operation<"/enterprises/{enterprise}/actions/runner-groups", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-group-for-an-enterprise
*/
"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#list-labels-for-a-self-hosted-runner-for-an-enterprise
*/
"GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels": Operation<"/enterprises/{enterprise}/actions/runners/{runner_id}/labels", "get">;
/**
* @see https://docs.github.com/rest/enterprise-admin#get-code-security-analysis-features-for-an-enterprise
*/
"GET /enterprises/{enterprise}/code_security_and_analysis": Operation<"/enterprises/{enterprise}/code_security_and_analysis", "get">;
/**
* @see https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise
*/
@ -817,6 +804,22 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/orgs#list-organizations
*/
"GET /organizations": Operation<"/organizations", "get">;
/**
* @see https://docs.github.com/rest/orgs/orgs#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens
*/
"GET /organizations/{org}/personal-access-token-requests": Operation<"/organizations/{org}/personal-access-token-requests", "get">;
/**
* @see https://docs.github.com/rest/orgs/orgs#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token
*/
"GET /organizations/{org}/personal-access-token-requests/{pat_request_id}/repositories": Operation<"/organizations/{org}/personal-access-token-requests/{pat_request_id}/repositories", "get">;
/**
* @see https://docs.github.com/rest/orgs/orgs#list-fine-grained-personal-access-tokens-with-access-to-organization-resources
*/
"GET /organizations/{org}/personal-access-tokens": Operation<"/organizations/{org}/personal-access-tokens", "get">;
/**
* @see https://docs.github.com/rest/orgs/orgs#list-repositories-a-fine-grained-personal-access-token-has-access-to
*/
"GET /organizations/{org}/personal-access-tokens/{pat_id}/repositories": Operation<"/organizations/{org}/personal-access-tokens/{pat_id}/repositories", "get">;
/**
* @see https://docs.github.com/rest/reference/codespaces#list-in-organization
* @deprecated "org_id" is now "org"
@ -866,22 +869,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/actions#list-selected-repositories-required-workflows
*/
"GET /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories": Operation<"/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#list-self-hosted-runner-groups-for-an-organization
*/
"GET /orgs/{org}/actions/runner-groups": Operation<"/orgs/{org}/actions/runner-groups", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#get-a-self-hosted-runner-group-for-an-organization
*/
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#list-repository-access-to-a-self-hosted-runner-group-in-an-organization
*/
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-in-a-group-for-an-organization
*/
"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#list-self-hosted-runners-for-an-organization
*/
@ -935,7 +922,7 @@ export interface Endpoints {
*/
"GET /orgs/{org}/blocks/{username}": Operation<"/orgs/{org}/blocks/{username}", "get">;
/**
* @see https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-by-organization
* @see https://docs.github.com/rest/reference/code-scanning#list-code-scanning-alerts-for-an-organization
*/
"GET /orgs/{org}/code-scanning/alerts": Operation<"/orgs/{org}/code-scanning/alerts", "get">;
/**
@ -978,6 +965,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/dependabot#list-selected-repositories-for-an-organization-secret
*/
"GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories": Operation<"/orgs/{org}/dependabot/secrets/{secret_name}/repositories", "get">;
/**
* @see https://docs.github.com/rest/reference/packages#list-docker-migration-conflicting-packages-for-organization
*/
"GET /orgs/{org}/docker/conflicts": Operation<"/orgs/{org}/docker/conflicts", "get">;
/**
* @see https://docs.github.com/rest/reference/activity#list-public-organization-events
*/
@ -1047,19 +1038,19 @@ export interface Endpoints {
*/
"GET /orgs/{org}/memberships/{username}": Operation<"/orgs/{org}/memberships/{username}", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#list-organization-migrations
* @see https://docs.github.com/rest/migrations/orgs#list-organization-migrations
*/
"GET /orgs/{org}/migrations": Operation<"/orgs/{org}/migrations", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#get-an-organization-migration-status
* @see https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status
*/
"GET /orgs/{org}/migrations/{migration_id}": Operation<"/orgs/{org}/migrations/{migration_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#download-an-organization-migration-archive
* @see https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive
*/
"GET /orgs/{org}/migrations/{migration_id}/archive": Operation<"/orgs/{org}/migrations/{migration_id}/archive", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#list-repositories-in-an-organization-migration
* @see https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration
*/
"GET /orgs/{org}/migrations/{migration_id}/repositories": Operation<"/orgs/{org}/migrations/{migration_id}/repositories", "get">;
/**
@ -1098,6 +1089,14 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/repos#list-organization-repositories
*/
"GET /orgs/{org}/repos": Operation<"/orgs/{org}/repos", "get">;
/**
* @see https://docs.github.com/rest/repos/rules#get-organization-rulesets
*/
"GET /orgs/{org}/rulesets": Operation<"/orgs/{org}/rulesets", "get">;
/**
* @see https://docs.github.com/rest/repos/rules#get-organization-ruleset
*/
"GET /orgs/{org}/rulesets/{ruleset_id}": Operation<"/orgs/{org}/rulesets/{ruleset_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-an-organization
*/
@ -1262,6 +1261,14 @@ export interface Endpoints {
* @see https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository
*/
"GET /repos/{owner}/{repo}/actions/oidc/customization/sub": Operation<"/repos/{owner}/{repo}/actions/oidc/customization/sub", "get">;
/**
* @see https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets
*/
"GET /repos/{owner}/{repo}/actions/organization-secrets": Operation<"/repos/{owner}/{repo}/actions/organization-secrets", "get">;
/**
* @see https://docs.github.com/rest/actions/variables#list-repository-organization-variables
*/
"GET /repos/{owner}/{repo}/actions/organization-variables": Operation<"/repos/{owner}/{repo}/actions/organization-variables", "get">;
/**
* @see https://docs.github.com/rest/reference/actions#get-github-actions-permissions-for-a-repository
*/
@ -1387,11 +1394,11 @@ export interface Endpoints {
*/
"GET /repos/{owner}/{repo}/assignees/{assignee}": Operation<"/repos/{owner}/{repo}/assignees/{assignee}", "get">;
/**
* @see https://docs.github.com/v3/repos#list-autolinks
* @see https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository
*/
"GET /repos/{owner}/{repo}/autolinks": Operation<"/repos/{owner}/{repo}/autolinks", "get">;
/**
* @see https://docs.github.com/v3/repos#get-autolink
* @see https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository
*/
"GET /repos/{owner}/{repo}/autolinks/{autolink_id}": Operation<"/repos/{owner}/{repo}/autolinks/{autolink_id}", "get">;
/**
@ -1484,15 +1491,19 @@ export interface Endpoints {
*/
"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}": Operation<"/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/code-scanning#list-codeql-databases
* @see https://docs.github.com/rest/reference/code-scanning#list-codeql-databases-for-a-repository
*/
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases": Operation<"/repos/{owner}/{repo}/code-scanning/codeql/databases", "get">;
/**
* @see https://docs.github.com/rest/reference/code-scanning#get-codeql-database
* @see https://docs.github.com/rest/reference/code-scanning#get-a-codeql-database-for-a-repository
*/
"GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}": Operation<"/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}", "get">;
/**
* @see https://docs.github.com/rest/reference/code-scanning#list-recent-code-scanning-analyses-for-a-repository
* @see https://docs.github.com/rest/code-scanning#get-a-code-scanning-default-setup-configuration
*/
"GET /repos/{owner}/{repo}/code-scanning/default-setup": Operation<"/repos/{owner}/{repo}/code-scanning/default-setup", "get">;
/**
* @see https://docs.github.com/rest/reference/code-scanning#get-information-about-a-sarif-upload
*/
"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}": Operation<"/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}", "get">;
/**
@ -1631,6 +1642,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/dependency-graph#get-a-diff-of-the-dependencies-between-commits
*/
"GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}": Operation<"/repos/{owner}/{repo}/dependency-graph/compare/{basehead}", "get">;
/**
* @see https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository
*/
"GET /repos/{owner}/{repo}/dependency-graph/sbom": Operation<"/repos/{owner}/{repo}/dependency-graph/sbom", "get">;
/**
* @see https://docs.github.com/rest/deployments/deployments#list-deployments
*/
@ -1663,6 +1678,18 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/branch-policies#get-deployment-branch-policy
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", "get">;
/**
* @see https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules", "get">;
/**
* @see https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps", "get">;
/**
* @see https://docs.github.com/rest/deployments/protection-rules#get-a-deployment-protection-rule
*/
"GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/activity#list-repository-events
*/
@ -1716,15 +1743,15 @@ export interface Endpoints {
*/
"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#get-an-import-status
* @see https://docs.github.com/rest/migrations/source-imports#get-an-import-status
*/
"GET /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#get-commit-authors
* @see https://docs.github.com/rest/migrations/source-imports#get-commit-authors
*/
"GET /repos/{owner}/{repo}/import/authors": Operation<"/repos/{owner}/{repo}/import/authors", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#get-large-files
* @see https://docs.github.com/rest/migrations/source-imports#get-large-files
*/
"GET /repos/{owner}/{repo}/import/large_files": Operation<"/repos/{owner}/{repo}/import/large_files", "get">;
/**
@ -1943,6 +1970,18 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/reactions/#list-reactions-for-a-release
*/
"GET /repos/{owner}/{repo}/releases/{release_id}/reactions": Operation<"/repos/{owner}/{repo}/releases/{release_id}/reactions", "get">;
/**
* @see https://docs.github.com/rest/repos/rules#get-rules-for-a-branch
*/
"GET /repos/{owner}/{repo}/rules/branches/{branch}": Operation<"/repos/{owner}/{repo}/rules/branches/{branch}", "get">;
/**
* @see https://docs.github.com/rest/repos/rules#get-repository-rulesets
*/
"GET /repos/{owner}/{repo}/rulesets": Operation<"/repos/{owner}/{repo}/rulesets", "get">;
/**
* @see https://docs.github.com/rest/repos/rules#get-repository-ruleset
*/
"GET /repos/{owner}/{repo}/rulesets/{ruleset_id}": Operation<"/repos/{owner}/{repo}/rulesets/{ruleset_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/secret-scanning#list-secret-scanning-alerts-for-a-repository
*/
@ -1955,6 +1994,14 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/secret-scanning#list-locations-for-a-secret-scanning-alert
*/
"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations": Operation<"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations", "get">;
/**
* @see https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories
*/
"GET /repos/{owner}/{repo}/security-advisories": Operation<"/repos/{owner}/{repo}/security-advisories", "get">;
/**
* @see https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory
*/
"GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}": Operation<"/repos/{owner}/{repo}/security-advisories/{ghsa_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/activity#list-stargazers
*/
@ -1976,7 +2023,7 @@ export interface Endpoints {
*/
"GET /repos/{owner}/{repo}/stats/participation": Operation<"/repos/{owner}/{repo}/stats/participation", "get">;
/**
* @see https://docs.github.com/rest/statistics/repos#get-the-hourly-commit-count-for-each-day
* @see https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day
*/
"GET /repos/{owner}/{repo}/stats/punch_card": Operation<"/repos/{owner}/{repo}/stats/punch_card", "get">;
/**
@ -2191,6 +2238,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/codespaces#list-machine-types-for-a-codespace
*/
"GET /user/codespaces/{codespace_name}/machines": Operation<"/user/codespaces/{codespace_name}/machines", "get">;
/**
* @see https://docs.github.com/rest/packages#list-docker-migration-conflicting-packages-for-authenticated-user
*/
"GET /user/docker/conflicts": Operation<"/user/docker/conflicts", "get">;
/**
* @see https://docs.github.com/rest/reference/users#list-email-addresses-for-the-authenticated-user
*/
@ -2256,19 +2307,19 @@ export interface Endpoints {
*/
"GET /user/memberships/orgs/{org}": Operation<"/user/memberships/orgs/{org}", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#list-user-migrations
* @see https://docs.github.com/rest/migrations/users#list-user-migrations
*/
"GET /user/migrations": Operation<"/user/migrations", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#get-a-user-migration-status
* @see https://docs.github.com/rest/migrations/users#get-a-user-migration-status
*/
"GET /user/migrations/{migration_id}": Operation<"/user/migrations/{migration_id}", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#download-a-user-migration-archive
* @see https://docs.github.com/rest/migrations/users#download-a-user-migration-archive
*/
"GET /user/migrations/{migration_id}/archive": Operation<"/user/migrations/{migration_id}/archive", "get">;
/**
* @see https://docs.github.com/rest/reference/migrations#list-repositories-for-a-user-migration
* @see https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration
*/
"GET /user/migrations/{migration_id}/repositories": Operation<"/user/migrations/{migration_id}/repositories", "get">;
/**
@ -2303,6 +2354,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user
*/
"GET /user/repository_invitations": Operation<"/user/repository_invitations", "get">;
/**
* @see https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user
*/
"GET /user/social_accounts": Operation<"/user/social_accounts", "get">;
/**
* @see https://docs.github.com/rest/reference/users#list-public-ssh-signing-keys-for-the-authenticated-user
*/
@ -2335,6 +2390,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/users#get-a-user
*/
"GET /users/{username}": Operation<"/users/{username}", "get">;
/**
* @see https://docs.github.com/rest/reference/packages#list-docker-migration-conflicting-packages-for-user
*/
"GET /users/{username}/docker/conflicts": Operation<"/users/{username}/docker/conflicts", "get">;
/**
* @see https://docs.github.com/rest/reference/activity#list-events-for-the-authenticated-user
*/
@ -2427,6 +2486,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/billing#get-shared-storage-billing-for-a-user
*/
"GET /users/{username}/settings/billing/shared-storage": Operation<"/users/{username}/settings/billing/shared-storage", "get">;
/**
* @see https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user
*/
"GET /users/{username}/social_accounts": Operation<"/users/{username}/social_accounts", "get">;
/**
* @see https://docs.github.com/rest/reference/users#list-ssh-signing-keys-for-a-user
*/
@ -2455,10 +2518,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/apps#reset-a-token
*/
"PATCH /applications/{client_id}/token": Operation<"/applications/{client_id}/token", "patch">;
/**
* @see https://docs.github.com/rest/enterprise-admin#update-code-security-and-analysis-features-for-an-enterprise
*/
"PATCH /enterprises/{enterprise}/code_security_and_analysis": Operation<"/enterprises/{enterprise}/code_security_and_analysis", "patch">;
/**
* @see https://docs.github.com/rest/reference/gists/#update-a-gist
*/
@ -2479,10 +2538,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/actions#update-a-required-workflow
*/
"PATCH /orgs/{org}/actions/required_workflows/{required_workflow_id}": Operation<"/orgs/{org}/actions/required_workflows/{required_workflow_id}", "patch">;
/**
* @see https://docs.github.com/rest/reference/actions#update-a-self-hosted-runner-group-for-an-organization
*/
"PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}", "patch">;
/**
* @see https://docs.github.com/rest/actions/variables#update-an-organization-variable
*/
@ -2547,6 +2602,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/code-scanning#update-a-code-scanning-alert
*/
"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", "patch">;
/**
* @see https://docs.github.com/rest/code-scanning#update-a-code-scanning-default-setup-configuration
*/
"PATCH /repos/{owner}/{repo}/code-scanning/default-setup": Operation<"/repos/{owner}/{repo}/code-scanning/default-setup", "patch">;
/**
* @see https://docs.github.com/rest/commits/comments#update-a-commit-comment
*/
@ -2568,15 +2627,15 @@ export interface Endpoints {
*/
"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config": Operation<"/repos/{owner}/{repo}/hooks/{hook_id}/config", "patch">;
/**
* @see https://docs.github.com/rest/reference/migrations#update-an-import
* @see https://docs.github.com/rest/migrations/source-imports#update-an-import
*/
"PATCH /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "patch">;
/**
* @see https://docs.github.com/rest/reference/migrations#map-a-commit-author
* @see https://docs.github.com/rest/migrations/source-imports#map-a-commit-author
*/
"PATCH /repos/{owner}/{repo}/import/authors/{author_id}": Operation<"/repos/{owner}/{repo}/import/authors/{author_id}", "patch">;
/**
* @see https://docs.github.com/rest/reference/migrations#update-git-lfs-preference
* @see https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference
*/
"PATCH /repos/{owner}/{repo}/import/lfs": Operation<"/repos/{owner}/{repo}/import/lfs", "patch">;
/**
@ -2619,6 +2678,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/secret-scanning#update-a-secret-scanning-alert
*/
"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}": Operation<"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}", "patch">;
/**
* @see https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory
*/
"PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}": Operation<"/repos/{owner}/{repo}/security-advisories/{ghsa_id}", "patch">;
/**
* @see https://docs.github.com/rest/actions/variables#update-an-environment-variable
*/
@ -2672,21 +2735,9 @@ export interface Endpoints {
*/
"POST /applications/{client_id}/token": Operation<"/applications/{client_id}/token", "post">;
/**
* @see https://docs.github.com/rest/reference/apps#create-a-scoped-access-token
* @see https://docs.github.com/rest/apps/apps#create-a-scoped-access-token
*/
"POST /applications/{client_id}/token/scoped": Operation<"/applications/{client_id}/token/scoped", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#create-self-hosted-runner-group-for-an-enterprise
*/
"POST /enterprises/{enterprise}/actions/runner-groups": Operation<"/enterprises/{enterprise}/actions/runner-groups", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise
*/
"POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels": Operation<"/enterprises/{enterprise}/actions/runners/{runner_id}/labels", "post">;
/**
* @see https://docs.github.com/rest/enterprise-admin#enable-or-disable-a-security-feature
*/
"POST /enterprises/{enterprise}/{security_product}/{enablement}": Operation<"/enterprises/{enterprise}/{security_product}/{enablement}", "post">;
/**
* @see https://docs.github.com/rest/reference/gists#create-a-gist
*/
@ -2707,14 +2758,30 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/markdown#render-a-markdown-document-in-raw-mode
*/
"POST /markdown/raw": Operation<"/markdown/raw", "post">;
/**
* @see https://docs.github.com/rest/orgs/orgs#review-requests-to-access-organization-resources-with-a-fine-grained-personal-access-token
*/
"POST /organizations/{org}/personal-access-token-requests": Operation<"/organizations/{org}/personal-access-token-requests", "post">;
/**
* @see https://docs.github.com/rest/orgs/orgs#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token
*/
"POST /organizations/{org}/personal-access-token-requests/{pat_request_id}": Operation<"/organizations/{org}/personal-access-token-requests/{pat_request_id}", "post">;
/**
* @see https://docs.github.com/rest/orgs/orgs#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens
*/
"POST /organizations/{org}/personal-access-tokens": Operation<"/organizations/{org}/personal-access-tokens", "post">;
/**
* @see https://docs.github.com/rest/orgs/orgs#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources
*/
"POST /organizations/{org}/personal-access-tokens/{pat_id}": Operation<"/organizations/{org}/personal-access-tokens/{pat_id}", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#create-a-required-workflow
*/
"POST /orgs/{org}/actions/required_workflows": Operation<"/orgs/{org}/actions/required_workflows", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#create-a-self-hosted-runner-group-for-an-organization
* @see https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization
*/
"POST /orgs/{org}/actions/runner-groups": Operation<"/orgs/{org}/actions/runner-groups", "post">;
"POST /orgs/{org}/actions/runners/generate-jitconfig": Operation<"/orgs/{org}/actions/runners/generate-jitconfig", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#create-a-registration-token-for-an-organization
*/
@ -2731,6 +2798,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/actions/variables#create-an-organization-variable
*/
"POST /orgs/{org}/actions/variables": Operation<"/orgs/{org}/actions/variables", "post">;
/**
* @see https://docs.github.com/rest/reference/codespaces#set-codespaces-billing-users
*/
"POST /orgs/{org}/codespaces/billing/selected_users": Operation<"/orgs/{org}/codespaces/billing/selected_users", "post">;
/**
* @see https://docs.github.com/rest/reference/orgs#create-an-organization-webhook
*/
@ -2752,7 +2823,7 @@ export interface Endpoints {
*/
"POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop": Operation<"/orgs/{org}/members/{username}/codespaces/{codespace_name}/stop", "post">;
/**
* @see https://docs.github.com/rest/reference/migrations#start-an-organization-migration
* @see https://docs.github.com/rest/migrations/orgs#start-an-organization-migration
*/
"POST /orgs/{org}/migrations": Operation<"/orgs/{org}/migrations", "post">;
/**
@ -2771,6 +2842,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/repos#create-an-organization-repository
*/
"POST /orgs/{org}/repos": Operation<"/orgs/{org}/repos", "post">;
/**
* @see https://docs.github.com/rest/repos/rules#create-organization-repository-ruleset
*/
"POST /orgs/{org}/rulesets": Operation<"/orgs/{org}/rulesets", "post">;
/**
* @see https://docs.github.com/rest/reference/teams#create-a-team
*/
@ -2815,6 +2890,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/actions#re-run-job-for-workflow-run
*/
"POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun": Operation<"/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun", "post">;
/**
* @see https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository
*/
"POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig": Operation<"/repos/{owner}/{repo}/actions/runners/generate-jitconfig", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#create-a-registration-token-for-a-repository
*/
@ -2835,6 +2914,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/actions#cancel-a-workflow-run
*/
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/cancel", "post">;
/**
* @see https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run
*/
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule": Operation<"/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule", "post">;
/**
* @see https://docs.github.com/rest/reference/actions#review-pending-deployments-for-a-workflow-run
*/
@ -2856,7 +2939,7 @@ export interface Endpoints {
*/
"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches": Operation<"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches", "post">;
/**
* @see https://docs.github.com/v3/repos#create-an-autolink
* @see https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository
*/
"POST /repos/{owner}/{repo}/autolinks": Operation<"/repos/{owner}/{repo}/autolinks", "post">;
/**
@ -2904,7 +2987,7 @@ export interface Endpoints {
*/
"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest": Operation<"/repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest", "post">;
/**
* @see https://docs.github.com/rest/reference/code-scanning#upload-a-sarif-file
* @see https://docs.github.com/rest/reference/code-scanning#upload-an-analysis-as-sarif-data
*/
"POST /repos/{owner}/{repo}/code-scanning/sarifs": Operation<"/repos/{owner}/{repo}/code-scanning/sarifs", "post">;
/**
@ -2939,6 +3022,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/deployments/branch-policies#create-deployment-branch-policy
*/
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies", "post">;
/**
* @see https://docs.github.com/rest/deployments/deployment-protection-rules#create-a-deployment-protection-rule
*/
"POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules", "post">;
/**
* @see https://docs.github.com/rest/reference/repos#create-a-fork
*/
@ -3072,7 +3159,7 @@ export interface Endpoints {
*/
"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events", "post">;
/**
* @see https://docs.github.com/rest/reference/repos#create-a-release
* @see https://docs.github.com/rest/releases/releases#create-a-release
*/
"POST /repos/{owner}/{repo}/releases": Operation<"/repos/{owner}/{repo}/releases", "post">;
/**
@ -3083,6 +3170,18 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/reactions/#create-reaction-for-a-release
*/
"POST /repos/{owner}/{repo}/releases/{release_id}/reactions": Operation<"/repos/{owner}/{repo}/releases/{release_id}/reactions", "post">;
/**
* @see https://docs.github.com/rest/repos/rules#create-repository-ruleset
*/
"POST /repos/{owner}/{repo}/rulesets": Operation<"/repos/{owner}/{repo}/rulesets", "post">;
/**
* @see https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory
*/
"POST /repos/{owner}/{repo}/security-advisories": Operation<"/repos/{owner}/{repo}/security-advisories", "post">;
/**
* @see https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability
*/
"POST /repos/{owner}/{repo}/security-advisories/reports": Operation<"/repos/{owner}/{repo}/security-advisories/reports", "post">;
/**
* @see https://docs.github.com/rest/commits/statuses#create-a-commit-status
*/
@ -3152,7 +3251,7 @@ export interface Endpoints {
*/
"POST /user/keys": Operation<"/user/keys", "post">;
/**
* @see https://docs.github.com/rest/reference/migrations#start-a-user-migration
* @see https://docs.github.com/rest/migrations/users#start-a-user-migration
*/
"POST /user/migrations": Operation<"/user/migrations", "post">;
/**
@ -3171,6 +3270,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/repos#create-a-repository-for-the-authenticated-user
*/
"POST /user/repos": Operation<"/user/repos", "post">;
/**
* @see https://docs.github.com/rest/users/social-accounts#add-social-account-for-authenticated-user
*/
"POST /user/social_accounts": Operation<"/user/social_accounts", "post">;
/**
* @see https://docs.github.com/rest/reference/users#create-an-ssh-signing-key-for-the-authenticated-user
*/
@ -3191,14 +3294,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/apps#suspend-an-app-installation
*/
"PUT /app/installations/{installation_id}/suspended": Operation<"/app/installations/{installation_id}/suspended", "put">;
/**
* @see https://docs.github.com/rest/reference/actions#enable-a-selected-organization-for-github-actions-in-an-enterprise
*/
"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}": Operation<"/enterprises/{enterprise}/actions/permissions/organizations/{org_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/actions#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise
*/
"PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}": Operation<"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/gists#star-a-gist
*/
@ -3243,18 +3338,6 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/actions#add-a-repository-to-selected-repositories-list-for-a-required-workflow
*/
"PUT /orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}": Operation<"/orgs/{org}/actions/required_workflows/{required_workflow_id}/repositories/{repository_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/actions#set-repository-access-to-a-self-hosted-runner-group-in-an-organization
*/
"PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories", "put">;
/**
* @see https://docs.github.com/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization
*/
"PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners", "put">;
/**
* @see https://docs.github.com/rest/reference/actions#add-a-self-hosted-runner-to-a-group-for-an-organization
*/
"PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}": Operation<"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/actions#set-custom-labels-for-a-self-hosted-runner-for-an-organization
*/
@ -3327,6 +3410,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/orgs#set-public-organization-membership-for-the-authenticated-user
*/
"PUT /orgs/{org}/public_members/{username}": Operation<"/orgs/{org}/public_members/{username}", "put">;
/**
* @see https://docs.github.com/rest/repos/rules#update-organization-ruleset
*/
"PUT /orgs/{org}/rulesets/{ruleset_id}": Operation<"/orgs/{org}/rulesets/{ruleset_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/orgs#add-a-security-manager-team
*/
@ -3432,7 +3519,7 @@ export interface Endpoints {
*/
"PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}": Operation<"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/migrations#start-an-import
* @see https://docs.github.com/rest/migrations/source-imports#start-an-import
*/
"PUT /repos/{owner}/{repo}/import": Operation<"/repos/{owner}/{repo}/import", "put">;
/**
@ -3475,6 +3562,10 @@ export interface Endpoints {
* @see https://docs.github.com/rest/reference/pulls#update-a-pull-request-branch
*/
"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch": Operation<"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch", "put">;
/**
* @see https://docs.github.com/rest/repos/rules#update-repository-ruleset
*/
"PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}": Operation<"/repos/{owner}/{repo}/rulesets/{ruleset_id}", "put">;
/**
* @see https://docs.github.com/rest/reference/activity#set-a-repository-subscription
*/

View file

@ -1,4 +0,0 @@
const VERSION = "9.0.0";
export { VERSION };
//# sourceMappingURL=index.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"index.js","sources":["../dist-src/VERSION.js"],"sourcesContent":["export const VERSION = \"0.0.0-development\";\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}

View file

@ -1,21 +1,14 @@
{
"name": "@octokit/types",
"description": "Shared TypeScript definitions for Octokit projects",
"version": "9.0.0",
"license": "MIT",
"files": [
"dist-*/",
"bin/"
],
"source": "dist-src/index.js",
"types": "dist-types/index.d.ts",
"octokit": {
"openapi-version": "10.0.0"
"version": "10.0.0",
"publishConfig": {
"access": "public"
},
"main": "dist-node/index.js",
"module": "dist-web/index.js",
"pika": true,
"sideEffects": false,
"description": "Shared TypeScript definitions for Octokit projects",
"dependencies": {
"@octokit/openapi-types": "^18.0.0"
},
"repository": "github:octokit/types.ts",
"keywords": [
"github",
"api",
@ -23,32 +16,31 @@
"toolkit",
"typescript"
],
"repository": "github:octokit/types.ts",
"dependencies": {
"@octokit/openapi-types": "^16.0.0"
},
"author": "Gregor Martynus (https://twitter.com/gr2m)",
"license": "MIT",
"devDependencies": {
"@pika/pack": "^0.3.7",
"@pika/plugin-build-node": "^0.9.0",
"@pika/plugin-build-web": "^0.9.0",
"@pika/plugin-ts-standard-pkg": "^0.9.0",
"@octokit/tsconfig": "^1.0.2",
"@types/node": ">= 8",
"github-openapi-graphql-query": "^3.0.0",
"github-openapi-graphql-query": "^4.0.0",
"handlebars": "^4.7.6",
"json-schema-to-typescript": "^11.0.0",
"json-schema-to-typescript": "^13.0.0",
"lodash.set": "^4.3.2",
"npm-run-all": "^4.1.5",
"pascal-case": "^3.1.1",
"pika-plugin-merge-properties": "^1.0.6",
"prettier": "^2.0.0",
"semantic-release": "^20.0.0",
"semantic-release": "^21.0.0",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"sort-keys": "^4.2.0",
"string-to-jsdoc-comment": "^1.0.0",
"typedoc": "^0.23.0",
"typescript": "^4.0.2"
"typedoc": "^0.24.0",
"typescript": "^5.0.0"
},
"publishConfig": {
"access": "public"
}
"octokit": {
"openapi-version": "12.0.0"
},
"files": [
"dist-types/**"
],
"types": "dist-types/index.d.ts",
"sideEffects": false
}

38
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "codeql",
"version": "2.20.0",
"version": "2.20.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codeql",
"version": "2.20.0",
"version": "2.20.1",
"license": "MIT",
"dependencies": {
"@actions/artifact": "^1.1.0",
@ -17,8 +17,8 @@
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1",
"@chrisgavin/safe-which": "^1.0.2",
"@octokit/plugin-retry": "^4.0.4",
"@octokit/types": "^9.0.0",
"@octokit/plugin-retry": "^5.0.2",
"@octokit/types": "^10.0.0",
"@schemastore/package": "^0.0.6",
"@types/uuid": "^9.0.0",
"adm-zip": "^0.5.9",
@ -613,9 +613,9 @@
}
},
"node_modules/@octokit/openapi-types": {
"version": "16.0.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-16.0.0.tgz",
"integrity": "sha512-JbFWOqTJVLHZSUUoF4FzAZKYtqdxWu9Z5m2QQnOyEa04fOFljvyh7D3GYKbfuaSWisqehImiVIMG4eyJeP5VEA=="
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-18.0.0.tgz",
"integrity": "sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw=="
},
"node_modules/@octokit/plugin-paginate-rest": {
"version": "2.4.0",
@ -652,20 +652,28 @@
}
},
"node_modules/@octokit/plugin-retry": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-4.0.4.tgz",
"integrity": "sha512-d7qGFLR3AH+WbNEDUvBPgMc7wRCxU40FZyNXFFqs8ISw75ZYS5/P3ScggzU13dCoY0aywYDxKugGstQTwNgppA==",
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-5.0.2.tgz",
"integrity": "sha512-/Z7rWLCfjwmaVdyFuMkZoAnhfrvYgtvDrbO2d6lv7XrvJa8gFGB5tLUMngfuyMBfDCc5B9+EVu7IkQx5ebVlMg==",
"dependencies": {
"@octokit/types": "^9.0.0",
"bottleneck": "^2.15.3"
},
"engines": {
"node": ">= 14"
"node": ">= 18"
},
"peerDependencies": {
"@octokit/core": ">=3"
}
},
"node_modules/@octokit/plugin-retry/node_modules/@octokit/types": {
"version": "9.3.2",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.3.2.tgz",
"integrity": "sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==",
"dependencies": {
"@octokit/openapi-types": "^18.0.0"
}
},
"node_modules/@octokit/request": {
"version": "5.4.9",
"integrity": "sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==",
@ -706,11 +714,11 @@
}
},
"node_modules/@octokit/types": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-9.0.0.tgz",
"integrity": "sha512-LUewfj94xCMH2rbD5YJ+6AQ4AVjFYTgpp6rboWM5T7N3IsIF65SBEOVcYMGAEzO/kKNiNaW4LoWtoThOhH06gw==",
"version": "10.0.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-10.0.0.tgz",
"integrity": "sha512-Vm8IddVmhCgU1fxC1eyinpwqzXPEYu0NrYzD3YZjlGjyftdLBTeqNblRC0jmJmgxbJIsQlyogVeGnrNaaMVzIg==",
"dependencies": {
"@octokit/openapi-types": "^16.0.0"
"@octokit/openapi-types": "^18.0.0"
}
},
"node_modules/@opentelemetry/api": {

View file

@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "2.20.0",
"version": "2.20.1",
"private": true,
"description": "CodeQL action",
"scripts": {
@ -29,8 +29,8 @@
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1",
"@chrisgavin/safe-which": "^1.0.2",
"@octokit/plugin-retry": "^4.0.4",
"@octokit/types": "^9.0.0",
"@octokit/plugin-retry": "^5.0.2",
"@octokit/types": "^10.0.0",
"@schemastore/package": "^0.0.6",
"@types/uuid": "^9.0.0",
"adm-zip": "^0.5.9",

View file

@ -0,0 +1,17 @@
name: "Resolve environment"
description: "Tests that the resolve-environment action works for Go"
versions: ["stable-v2.13.4"]
steps:
- uses: ./../action/init
with:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/resolve-environment
id: resolve-environment
with:
language: go
- name: "Fail if no Go configuration was returned"
if: (!fromJSON(steps.resolve-environment.outputs.environment).configuration.go)
run: exit 1

View file

@ -0,0 +1,23 @@
name: 'CodeQL: Resolve Build Environment'
description: '[Experimental] Attempt to infer a build environment suitable for automatic builds'
author: 'GitHub'
inputs:
token:
default: ${{ github.token }}
matrix:
default: ${{ toJson(matrix) }}
language:
description: The language to infer the build environment configuration for.
required: true
working-directory:
description: >-
Resolve the build environment based on the files located at the specified
path (relative to $GITHUB_WORKSPACE). If this input is not set, then the
build environment is resolved based on the files in $GITHUB_WORKSPACE.
required: false
outputs:
environment:
description: The inferred build environment configuration.
runs:
using: 'node16'
main: '../lib/resolve-environment-action.js'

View file

@ -5,6 +5,7 @@ import test from "ava";
import * as sinon from "sinon";
import * as actionsutil from "./actions-util";
import * as sharedEnv from "./shared-environment";
import { setupActionsVars, setupTests } from "./testing-utils";
import { initializeEnvironment, withTmpDir } from "./util";
@ -265,3 +266,54 @@ test("isAnalyzingDefaultBranch()", async (t) => {
getAdditionalInputStub.restore();
});
});
test("createStatusReportBase", async (t) => {
await withTmpDir(async (tmpDir: string) => {
setupActionsVars(tmpDir, tmpDir);
process.env["GITHUB_REF"] = "refs/heads/main";
process.env["GITHUB_SHA"] = "a".repeat(40);
process.env["GITHUB_RUN_ID"] = "100";
process.env["GITHUB_RUN_ATTEMPT"] = "2";
process.env["GITHUB_REPOSITORY"] = "octocat/HelloWorld";
process.env["CODEQL_ACTION_ANALYSIS_KEY"] = "analysis-key";
process.env["RUNNER_OS"] = "macOS";
const getRequiredInput = sinon.stub(actionsutil, "getRequiredInput");
getRequiredInput.withArgs("matrix").resolves("input/matrix");
const statusReport = await actionsutil.createStatusReportBase(
"init",
"failure",
new Date("May 19, 2023 05:19:00"),
"failure cause",
"exception stack trace"
);
t.assert(typeof statusReport.job_run_uuid === "string");
t.assert(statusReport.workflow_run_id === 100);
t.assert(statusReport.workflow_run_attempt === 2);
t.assert(
statusReport.workflow_name === (process.env["GITHUB_WORKFLOW"] || "")
);
t.assert(statusReport.job_name === (process.env["GITHUB_JOB"] || ""));
t.assert(statusReport.analysis_key === "analysis-key");
t.assert(statusReport.commit_oid === process.env["GITHUB_SHA"]);
t.assert(statusReport.ref === process.env["GITHUB_REF"]);
t.assert(statusReport.action_name === "init");
t.assert(statusReport.action_oid === "unknown");
t.assert(
statusReport.started_at ===
process.env[sharedEnv.CODEQL_WORKFLOW_STARTED_AT]
);
t.assert(
statusReport.action_started_at ===
new Date("May 19, 2023 05:19:00").toISOString()
);
t.assert(statusReport.status === "failure");
t.assert(statusReport.cause === "failure cause");
t.assert(statusReport.exception === "exception stack trace");
t.assert(statusReport.runner_os === process.env["RUNNER_OS"]);
t.assert(typeof statusReport.action_version === "string");
});
});

View file

@ -36,9 +36,9 @@ const pkg = require("../package.json") as JSONSchemaForNPMPackageJsonFiles;
*
* This allows us to get stronger type checking of required/optional inputs.
*/
export function getRequiredInput(name: string): string {
export const getRequiredInput = function (name: string): string {
return core.getInput(name, { required: true });
}
};
/**
* Wrapper around core.getInput that converts empty inputs to undefined.
@ -306,7 +306,8 @@ type ActionName =
| "autobuild"
| "finish"
| "upload-sarif"
| "init-post";
| "init-post"
| "resolve-environment";
export type ActionStatus =
| "starting"
| "aborted"
@ -315,6 +316,18 @@ export type ActionStatus =
| "user-error";
export interface StatusReportBase {
/**
* UUID representing the job run that this status report belongs to. We
* generate our own UUID here because Actions currently does not expose a
* unique job run identifier. This UUID will allow us to more easily match
* reports from different steps in the same workflow job.
*
* If and when Actions does expose a unique job ID, we plan to populate a
* separate int field, `job_run_id`, with the Actions-generated identifier,
* as it will allow us to more easily join our telemetry data with Actions
* telemetry tables.
*/
job_run_uuid: string;
/** ID of the workflow run containing the action run. */
workflow_run_id: number;
/** Attempt number of the run containing the action run. */
@ -411,6 +424,7 @@ export async function createStatusReportBase(
): Promise<StatusReportBase> {
const commitOid = getOptionalInput("sha") || process.env["GITHUB_SHA"] || "";
const ref = await getRef();
const jobRunUUID = process.env[sharedEnv.JOB_RUN_UUID] || "";
const workflowRunID = getWorkflowRunID();
const workflowRunAttempt = getWorkflowRunAttempt();
const workflowName = process.env["GITHUB_WORKFLOW"] || "";
@ -439,6 +453,7 @@ export async function createStatusReportBase(
}
const statusReport: StatusReportBase = {
job_run_uuid: jobRunUUID,
workflow_run_id: workflowRunID,
workflow_run_attempt: workflowRunAttempt,
workflow_name: workflowName,

View file

@ -1 +1 @@
{"maximumVersion": "3.10", "minimumVersion": "3.6"}
{"maximumVersion": "3.10", "minimumVersion": "3.5"}

View file

@ -118,6 +118,13 @@ export interface CodeQL {
queries: string[],
extraSearchPath: string | undefined
): Promise<ResolveQueriesOutput>;
/**
* Run 'codeql resolve build-environment'
*/
resolveBuildEnvironment(
workingDir: string | undefined,
language: Language
): Promise<ResolveBuildEnvironmentOutput>;
/**
* Run 'codeql pack download'.
@ -229,6 +236,14 @@ export interface ResolveQueriesOutput {
};
}
export interface ResolveBuildEnvironmentOutput {
configuration?: {
[language: string]: {
[key: string]: unknown;
};
};
}
export interface PackDownloadOutput {
packs: PackDownloadItem[];
}
@ -289,6 +304,11 @@ export const CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = "2.12.1";
*/
export const CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
/**
* Versions 2.13.4+ of the CodeQL CLI support the `resolve build-environment` command.
*/
export const CODEQL_VERSION_RESOLVE_ENVIRONMENT = "2.13.4";
/**
* Set up CodeQL CLI access.
*
@ -402,6 +422,10 @@ export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
"betterResolveLanguages"
),
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
resolveBuildEnvironment: resolveFunction(
partialCodeql,
"resolveBuildEnvironment"
),
packDownload: resolveFunction(partialCodeql, "packDownload"),
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
databaseBundle: resolveFunction(partialCodeql, "databaseBundle"),
@ -681,6 +705,29 @@ export async function getCodeQLForCmd(
throw new Error(`Unexpected output from codeql resolve queries: ${e}`);
}
},
async resolveBuildEnvironment(
workingDir: string | undefined,
language: Language
) {
const codeqlArgs = [
"resolve",
"build-environment",
`--language=${language}`,
...getExtraOptionsFromEnv(["resolve", "build-environment"]),
];
if (workingDir !== undefined) {
codeqlArgs.push("--working-dir", workingDir);
}
const output = await runTool(cmd, codeqlArgs);
try {
return JSON.parse(output);
} catch (e) {
throw new Error(
`Unexpected output from codeql resolve build-environment: ${e} in\n${output}`
);
}
},
async databaseRunQueries(
databasePath: string,
extraSearchPath: string | undefined,

Some files were not shown because too many files have changed in this diff Show more