chore(deps): update actions/github to v5 (#961) [skip ci]

This commit is contained in:
Simon Lecoq
2022-03-24 02:12:44 +01:00
committed by GitHub
parent b7c1ac781d
commit 2430857cc8
4 changed files with 21 additions and 42 deletions

View File

@@ -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"

53
package-lock.json generated
View File

@@ -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": {

View File

@@ -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",

View File

@@ -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)