Skip to content

Commit

Permalink
Merge pull request #4 from timroes/fix-issues
Browse files Browse the repository at this point in the history
Use octokit directly
  • Loading branch information
timroes authored Mar 25, 2022
2 parents aee2071 + 3a02541 commit 5e79b91
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 6 deletions.
15 changes: 12 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61484,18 +61484,19 @@ try {
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

const core = __webpack_require__(42186);
const { GitHub, getOctokitOptions } = __webpack_require__(73030);
const { Octokit } = __webpack_require__(17342);
const { getOctokitOptions } = __webpack_require__(73030);
const retry = __webpack_require__(86298);
const throttling = __webpack_require__(9968);
const _ = __webpack_require__(90250);
const config = __webpack_require__(34570);

const Octokit = GitHub.plugin(retry, throttling);
let octokit;

function getOctokit(token) {
if (!octokit) {
octokit = new Octokit(getOctokitOptions(token, {
const ConfiguredOctokit = Octokit.plugin(retry, throttling);
octokit = new ConfiguredOctokit(getOctokitOptions(token, {
request: {
retries: 2,
},
Expand Down Expand Up @@ -61642,6 +61643,14 @@ async function stop() {
})();


/***/ }),

/***/ 17342:
/***/ ((module) => {

module.exports = eval("require")("@actions/rest");


/***/ }),

/***/ 22877:
Expand Down
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@actions/github": "^4.0.0",
"@octokit/plugin-retry": "^3.0.9",
"@octokit/plugin-throttling": "^3.6.2",
"@octokit/rest": "^18.12.0",
"aws-sdk": "^2.809.0",
"lodash": "^4.17.21"
},
Expand Down
7 changes: 4 additions & 3 deletions src/gh.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const core = require('@actions/core');
const { GitHub, getOctokitOptions } = require('@actions/github/lib/utils');
const { Octokit } = require('@actions/rest');
const { getOctokitOptions } = require('@actions/github/lib/utils');
const retry = require('@octokit/plugin-retry');
const throttling = require('@octokit/plugin-throttling');
const _ = require('lodash');
const config = require('./config');

const Octokit = GitHub.plugin(retry, throttling);
let octokit;

function getOctokit(token) {
if (!octokit) {
octokit = new Octokit(getOctokitOptions(token, {
const ConfiguredOctokit = Octokit.plugin(retry, throttling);
octokit = new ConfiguredOctokit(getOctokitOptions(token, {
request: {
retries: 2,
},
Expand Down

0 comments on commit 5e79b91

Please sign in to comment.