mirror of
https://github.com/softprops/action-gh-release.git
synced 2025-05-11 19:04:20 +00:00
try alt constructor
This commit is contained in:
parent
8b7cadcf54
commit
3c2ce6b9bd
2 changed files with 70 additions and 22 deletions
50
dist/index.js
vendored
50
dist/index.js
vendored
|
@ -2100,6 +2100,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const util_1 = __webpack_require__(322);
|
const util_1 = __webpack_require__(322);
|
||||||
const github_1 = __webpack_require__(146);
|
const github_1 = __webpack_require__(146);
|
||||||
|
const github_2 = __webpack_require__(469);
|
||||||
const core_1 = __webpack_require__(470);
|
const core_1 = __webpack_require__(470);
|
||||||
const utils_1 = __webpack_require__(521);
|
const utils_1 = __webpack_require__(521);
|
||||||
const process_1 = __webpack_require__(765);
|
const process_1 = __webpack_require__(765);
|
||||||
|
@ -2120,7 +2121,8 @@ function run() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const oktokit = utils_1.GitHub.plugin(__webpack_require__(617), __webpack_require__(755));
|
const oktokit = utils_1.GitHub.plugin(__webpack_require__(617), __webpack_require__(755));
|
||||||
const gh = new oktokit(utils_1.getOctokitOptions(config.github_token, {
|
const gh = github_2.getOctokit(config.github_token, {
|
||||||
|
//new oktokit(
|
||||||
throttle: {
|
throttle: {
|
||||||
onRateLimit: (retryAfter, options) => {
|
onRateLimit: (retryAfter, options) => {
|
||||||
console.warn(`Request quota exhausted for request ${options.method} ${options.url}`);
|
console.warn(`Request quota exhausted for request ${options.method} ${options.url}`);
|
||||||
|
@ -2135,7 +2137,8 @@ function run() {
|
||||||
console.warn(`Abuse detected for request ${options.method} ${options.url}`);
|
console.warn(`Abuse detected for request ${options.method} ${options.url}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
});
|
||||||
|
//);
|
||||||
let rel = yield github_1.release(config, new github_1.GitHubReleaser(gh));
|
let rel = yield github_1.release(config, new github_1.GitHubReleaser(gh));
|
||||||
if (config.input_files) {
|
if (config.input_files) {
|
||||||
const files = util_1.paths(config.input_files);
|
const files = util_1.paths(config.input_files);
|
||||||
|
@ -7884,6 +7887,49 @@ exports.RequestError = RequestError;
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 469:
|
||||||
|
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||||
|
if (k2 === undefined) k2 = k;
|
||||||
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||||
|
}) : (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.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||||
|
__setModuleDefault(result, mod);
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.getOctokit = exports.context = void 0;
|
||||||
|
const Context = __importStar(__webpack_require__(262));
|
||||||
|
const utils_1 = __webpack_require__(521);
|
||||||
|
exports.context = new Context.Context();
|
||||||
|
/**
|
||||||
|
* Returns a hydrated octokit ready to use for GitHub Actions
|
||||||
|
*
|
||||||
|
* @param token the repo PAT or GITHUB_TOKEN
|
||||||
|
* @param options other options to set
|
||||||
|
*/
|
||||||
|
function getOctokit(token, options) {
|
||||||
|
return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));
|
||||||
|
}
|
||||||
|
exports.getOctokit = getOctokit;
|
||||||
|
//# sourceMappingURL=github.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 470:
|
/***/ 470:
|
||||||
|
|
42
src/main.ts
42
src/main.ts
|
@ -1,5 +1,6 @@
|
||||||
import { paths, parseConfig, isTag, unmatchedPatterns } from "./util";
|
import { paths, parseConfig, isTag, unmatchedPatterns } from "./util";
|
||||||
import { release, upload, GitHubReleaser } from "./github";
|
import { release, upload, GitHubReleaser } from "./github";
|
||||||
|
import { getOctokit } from "@actions/github";
|
||||||
import { setFailed, setOutput } from "@actions/core";
|
import { setFailed, setOutput } from "@actions/core";
|
||||||
import { GitHub, getOctokitOptions } from "@actions/github/lib/utils";
|
import { GitHub, getOctokitOptions } from "@actions/github/lib/utils";
|
||||||
|
|
||||||
|
@ -24,33 +25,34 @@ async function run() {
|
||||||
throw new Error(`⚠️ There were unmatched files`);
|
throw new Error(`⚠️ There were unmatched files`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const oktokit = GitHub.plugin(
|
const oktokit = GitHub.plugin(
|
||||||
require("@octokit/plugin-throttling"),
|
require("@octokit/plugin-throttling"),
|
||||||
require("@octokit/plugin-retry")
|
require("@octokit/plugin-retry")
|
||||||
);
|
);
|
||||||
|
|
||||||
const gh = new oktokit(
|
const gh = getOctokit(config.github_token, {
|
||||||
getOctokitOptions(config.github_token, {
|
//new oktokit(
|
||||||
throttle: {
|
throttle: {
|
||||||
onRateLimit: (retryAfter, options) => {
|
onRateLimit: (retryAfter, options) => {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Request quota exhausted for request ${options.method} ${options.url}`
|
`Request quota exhausted for request ${options.method} ${options.url}`
|
||||||
);
|
);
|
||||||
if (options.request.retryCount === 0) {
|
if (options.request.retryCount === 0) {
|
||||||
// only retries once
|
// only retries once
|
||||||
console.log(`Retrying after ${retryAfter} seconds!`);
|
console.log(`Retrying after ${retryAfter} seconds!`);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
},
|
|
||||||
onAbuseLimit: (retryAfter, options) => {
|
|
||||||
// does not retry, only logs a warning
|
|
||||||
console.warn(
|
|
||||||
`Abuse detected for request ${options.method} ${options.url}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onAbuseLimit: (retryAfter, options) => {
|
||||||
|
// does not retry, only logs a warning
|
||||||
|
console.warn(
|
||||||
|
`Abuse detected for request ${options.method} ${options.url}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
);
|
});
|
||||||
|
//);
|
||||||
let rel = await release(config, new GitHubReleaser(gh));
|
let rel = await release(config, new GitHubReleaser(gh));
|
||||||
if (config.input_files) {
|
if (config.input_files) {
|
||||||
const files = paths(config.input_files);
|
const files = paths(config.input_files);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue