diff --git a/.github/scripts/release.mjs b/.github/scripts/release.mjs index 1da51460..236212f4 100644 --- a/.github/scripts/release.mjs +++ b/.github/scripts/release.mjs @@ -10,7 +10,7 @@ const git = sgit(__metrics) //Setup octokit const token = process.env.GITHUB_TOKEN -const rest = github.getOctokit(token) +const rest = github.getOctokit(token).rest //Environment const maintainer = "lowlighter" diff --git a/package-lock.json b/package-lock.json index 75164cfe..30943175 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", - "@actions/github": "^4.0.0", + "@actions/github": "^5.0.0", "@faker-js/faker": "^6.0.0-alpha.3", "@octokit/graphql": "^4.8.0", "@octokit/rest": "^18.12.0", @@ -67,26 +67,14 @@ } }, "node_modules/@actions/github": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-4.0.0.tgz", - "integrity": "sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz", + "integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==", "dependencies": { - "@actions/http-client": "^1.0.8", - "@octokit/core": "^3.0.0", - "@octokit/plugin-paginate-rest": "^2.2.3", - "@octokit/plugin-rest-endpoint-methods": "^4.0.0" - } - }, - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.15.1.tgz", - "integrity": "sha512-4gQg4ySoW7ktKB0Mf38fHzcSffVZd6mT5deJQtpqkuPuAqzlED5AJTeW8Uk7dPRn7KaOlWcXB0MedTFJU1j4qA==", - "dependencies": { - "@octokit/types": "^6.13.0", - "deprecation": "^2.3.1" - }, - "peerDependencies": { - "@octokit/core": ">=3" + "@actions/http-client": "^1.0.11", + "@octokit/core": "^3.4.0", + "@octokit/plugin-paginate-rest": "^2.13.3", + "@octokit/plugin-rest-endpoint-methods": "^5.1.1" } }, "node_modules/@actions/http-client": { @@ -10151,25 +10139,14 @@ } }, "@actions/github": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-4.0.0.tgz", - "integrity": "sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-5.0.0.tgz", + "integrity": "sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==", "requires": { - "@actions/http-client": "^1.0.8", - "@octokit/core": "^3.0.0", - "@octokit/plugin-paginate-rest": "^2.2.3", - "@octokit/plugin-rest-endpoint-methods": "^4.0.0" - }, - "dependencies": { - "@octokit/plugin-rest-endpoint-methods": { - "version": "4.15.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.15.1.tgz", - "integrity": "sha512-4gQg4ySoW7ktKB0Mf38fHzcSffVZd6mT5deJQtpqkuPuAqzlED5AJTeW8Uk7dPRn7KaOlWcXB0MedTFJU1j4qA==", - "requires": { - "@octokit/types": "^6.13.0", - "deprecation": "^2.3.1" - } - } + "@actions/http-client": "^1.0.11", + "@octokit/core": "^3.4.0", + "@octokit/plugin-paginate-rest": "^2.13.3", + "@octokit/plugin-rest-endpoint-methods": "^5.1.1" } }, "@actions/http-client": { diff --git a/package.json b/package.json index 0a40e161..f9b85c66 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/lowlighter/metrics#readme", "dependencies": { "@actions/core": "^1.6.0", - "@actions/github": "^4.0.0", + "@actions/github": "^5.0.0", "@faker-js/faker": "^6.0.0-alpha.3", "@octokit/graphql": "^4.8.0", "@octokit/rest": "^18.12.0", diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs index 06d1538f..8973aa6b 100644 --- a/source/app/action/index.mjs +++ b/source/app/action/index.mjs @@ -163,7 +163,9 @@ async function retry(func, {retries = 1, delay = 0} = {}) { const api = {} api.graphql = octokit.graphql.defaults({headers:{authorization:`token ${token}`}}) info("Github GraphQL API", "ok") - api.rest = github.getOctokit(token) + const octoraw = github.getOctokit(token) + api.rest = octoraw.rest + api.rest.request = octoraw.request info("Github REST API", "ok") //Apply mocking if needed if (mocked) { @@ -222,7 +224,7 @@ async function retry(func, {retries = 1, delay = 0} = {}) { if (committer.gist) info("Committer Gist id", committer.gist) //Instantiate API for committer - committer.rest = github.getOctokit(committer.token) + committer.rest = github.getOctokit(committer.token).rest info("Committer REST API", "ok") try { info("Committer account", (await committer.rest.users.getAuthenticated()).data.login)