Fixed error with API call
This commit is contained in:
parent
43a0752434
commit
3071e92d9c
@ -34,6 +34,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "1.10.0",
|
"@actions/core": "1.10.0",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "1.1.1",
|
||||||
|
"@actions/github": "5.1.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"micromatch": "^4.0.5",
|
"micromatch": "^4.0.5",
|
||||||
"yaml": "^2.3.1",
|
"yaml": "^2.3.1",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {Octokit} from '@octokit/rest'
|
import * as github from '@actions/github'
|
||||||
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
import type {RestEndpointMethodTypes} from '@octokit/rest'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
|
||||||
@ -260,6 +260,9 @@ export const getChangedFilesFromGithubAPI = async ({
|
|||||||
inputs: Inputs
|
inputs: Inputs
|
||||||
env: Env
|
env: Env
|
||||||
}): Promise<ChangedFiles> => {
|
}): Promise<ChangedFiles> => {
|
||||||
|
const octokit = github.getOctokit(inputs.token, {
|
||||||
|
baseUrl: inputs.api_url
|
||||||
|
})
|
||||||
const changedFiles: ChangedFiles = {
|
const changedFiles: ChangedFiles = {
|
||||||
[ChangeTypeEnum.Added]: [],
|
[ChangeTypeEnum.Added]: [],
|
||||||
[ChangeTypeEnum.Copied]: [],
|
[ChangeTypeEnum.Copied]: [],
|
||||||
@ -271,16 +274,11 @@ export const getChangedFilesFromGithubAPI = async ({
|
|||||||
[ChangeTypeEnum.Unknown]: []
|
[ChangeTypeEnum.Unknown]: []
|
||||||
}
|
}
|
||||||
|
|
||||||
const octokit = new Octokit({
|
|
||||||
auth: inputs.token,
|
|
||||||
baseUrl: inputs.api_url
|
|
||||||
})
|
|
||||||
|
|
||||||
core.info('Getting changed files from GitHub API...')
|
core.info('Getting changed files from GitHub API...')
|
||||||
for await (const response of octokit.paginate.iterator<
|
for await (const response of octokit.paginate.iterator<
|
||||||
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
|
RestEndpointMethodTypes['pulls']['listFiles']['response']['data'][0]
|
||||||
>(
|
>(
|
||||||
octokit.pulls.listFiles.endpoint.merge({
|
octokit.rest.pulls.listFiles.endpoint.merge({
|
||||||
owner: env.GITHUB_REPOSITORY_OWNER,
|
owner: env.GITHUB_REPOSITORY_OWNER,
|
||||||
repo: env.GITHUB_REPOSITORY,
|
repo: env.GITHUB_REPOSITORY,
|
||||||
pull_number: env.GITHUB_EVENT_PULL_REQUEST_NUMBER,
|
pull_number: env.GITHUB_EVENT_PULL_REQUEST_NUMBER,
|
||||||
|
98
yarn.lock
98
yarn.lock
@ -17,6 +17,16 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@actions/io" "^1.0.1"
|
"@actions/io" "^1.0.1"
|
||||||
|
|
||||||
|
"@actions/github@5.1.1":
|
||||||
|
version "5.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.1.1.tgz#40b9b9e1323a5efcf4ff7dadd33d8ea51651bbcb"
|
||||||
|
integrity sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==
|
||||||
|
dependencies:
|
||||||
|
"@actions/http-client" "^2.0.1"
|
||||||
|
"@octokit/core" "^3.6.0"
|
||||||
|
"@octokit/plugin-paginate-rest" "^2.17.0"
|
||||||
|
"@octokit/plugin-rest-endpoint-methods" "^5.13.0"
|
||||||
|
|
||||||
"@actions/http-client@^2.0.1":
|
"@actions/http-client@^2.0.1":
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.1.0.tgz#b6d8c3934727d6a50d10d19f00a711a964599a9f"
|
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.1.0.tgz#b6d8c3934727d6a50d10d19f00a711a964599a9f"
|
||||||
@ -655,11 +665,31 @@
|
|||||||
"@nodelib/fs.scandir" "2.1.5"
|
"@nodelib/fs.scandir" "2.1.5"
|
||||||
fastq "^1.6.0"
|
fastq "^1.6.0"
|
||||||
|
|
||||||
|
"@octokit/auth-token@^2.4.4":
|
||||||
|
version "2.5.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36"
|
||||||
|
integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/types" "^6.0.3"
|
||||||
|
|
||||||
"@octokit/auth-token@^3.0.0":
|
"@octokit/auth-token@^3.0.0":
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.4.tgz#70e941ba742bdd2b49bdb7393e821dea8520a3db"
|
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.4.tgz#70e941ba742bdd2b49bdb7393e821dea8520a3db"
|
||||||
integrity sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ==
|
integrity sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ==
|
||||||
|
|
||||||
|
"@octokit/core@^3.6.0":
|
||||||
|
version "3.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085"
|
||||||
|
integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/auth-token" "^2.4.4"
|
||||||
|
"@octokit/graphql" "^4.5.8"
|
||||||
|
"@octokit/request" "^5.6.3"
|
||||||
|
"@octokit/request-error" "^2.0.5"
|
||||||
|
"@octokit/types" "^6.0.3"
|
||||||
|
before-after-hook "^2.2.0"
|
||||||
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
"@octokit/core@^4.2.1":
|
"@octokit/core@^4.2.1":
|
||||||
version "4.2.4"
|
version "4.2.4"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.2.4.tgz#d8769ec2b43ff37cc3ea89ec4681a20ba58ef907"
|
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.2.4.tgz#d8769ec2b43ff37cc3ea89ec4681a20ba58ef907"
|
||||||
@ -673,6 +703,15 @@
|
|||||||
before-after-hook "^2.2.0"
|
before-after-hook "^2.2.0"
|
||||||
universal-user-agent "^6.0.0"
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
|
"@octokit/endpoint@^6.0.1":
|
||||||
|
version "6.0.12"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658"
|
||||||
|
integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/types" "^6.0.3"
|
||||||
|
is-plain-object "^5.0.0"
|
||||||
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
"@octokit/endpoint@^7.0.0":
|
"@octokit/endpoint@^7.0.0":
|
||||||
version "7.0.6"
|
version "7.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.6.tgz#791f65d3937555141fb6c08f91d618a7d645f1e2"
|
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.6.tgz#791f65d3937555141fb6c08f91d618a7d645f1e2"
|
||||||
@ -682,6 +721,15 @@
|
|||||||
is-plain-object "^5.0.0"
|
is-plain-object "^5.0.0"
|
||||||
universal-user-agent "^6.0.0"
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
|
"@octokit/graphql@^4.5.8":
|
||||||
|
version "4.8.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3"
|
||||||
|
integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/request" "^5.6.0"
|
||||||
|
"@octokit/types" "^6.0.3"
|
||||||
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
"@octokit/graphql@^5.0.0":
|
"@octokit/graphql@^5.0.0":
|
||||||
version "5.0.6"
|
version "5.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.6.tgz#9eac411ac4353ccc5d3fca7d76736e6888c5d248"
|
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.6.tgz#9eac411ac4353ccc5d3fca7d76736e6888c5d248"
|
||||||
@ -691,11 +739,23 @@
|
|||||||
"@octokit/types" "^9.0.0"
|
"@octokit/types" "^9.0.0"
|
||||||
universal-user-agent "^6.0.0"
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
|
"@octokit/openapi-types@^12.11.0":
|
||||||
|
version "12.11.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0"
|
||||||
|
integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==
|
||||||
|
|
||||||
"@octokit/openapi-types@^18.0.0":
|
"@octokit/openapi-types@^18.0.0":
|
||||||
version "18.0.0"
|
version "18.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69"
|
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69"
|
||||||
integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==
|
integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==
|
||||||
|
|
||||||
|
"@octokit/plugin-paginate-rest@^2.17.0":
|
||||||
|
version "2.21.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e"
|
||||||
|
integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/types" "^6.40.0"
|
||||||
|
|
||||||
"@octokit/plugin-paginate-rest@^6.1.2":
|
"@octokit/plugin-paginate-rest@^6.1.2":
|
||||||
version "6.1.2"
|
version "6.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz#f86456a7a1fe9e58fec6385a85cf1b34072341f8"
|
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-6.1.2.tgz#f86456a7a1fe9e58fec6385a85cf1b34072341f8"
|
||||||
@ -709,6 +769,14 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85"
|
resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85"
|
||||||
integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==
|
integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==
|
||||||
|
|
||||||
|
"@octokit/plugin-rest-endpoint-methods@^5.13.0":
|
||||||
|
version "5.16.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342"
|
||||||
|
integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/types" "^6.39.0"
|
||||||
|
deprecation "^2.3.1"
|
||||||
|
|
||||||
"@octokit/plugin-rest-endpoint-methods@^7.1.2":
|
"@octokit/plugin-rest-endpoint-methods@^7.1.2":
|
||||||
version "7.2.3"
|
version "7.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.2.3.tgz#37a84b171a6cb6658816c82c4082ac3512021797"
|
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.2.3.tgz#37a84b171a6cb6658816c82c4082ac3512021797"
|
||||||
@ -716,6 +784,15 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@octokit/types" "^10.0.0"
|
"@octokit/types" "^10.0.0"
|
||||||
|
|
||||||
|
"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0":
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677"
|
||||||
|
integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/types" "^6.0.3"
|
||||||
|
deprecation "^2.0.0"
|
||||||
|
once "^1.4.0"
|
||||||
|
|
||||||
"@octokit/request-error@^3.0.0":
|
"@octokit/request-error@^3.0.0":
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.3.tgz#ef3dd08b8e964e53e55d471acfe00baa892b9c69"
|
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.3.tgz#ef3dd08b8e964e53e55d471acfe00baa892b9c69"
|
||||||
@ -725,6 +802,18 @@
|
|||||||
deprecation "^2.0.0"
|
deprecation "^2.0.0"
|
||||||
once "^1.4.0"
|
once "^1.4.0"
|
||||||
|
|
||||||
|
"@octokit/request@^5.6.0", "@octokit/request@^5.6.3":
|
||||||
|
version "5.6.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0"
|
||||||
|
integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/endpoint" "^6.0.1"
|
||||||
|
"@octokit/request-error" "^2.1.0"
|
||||||
|
"@octokit/types" "^6.16.1"
|
||||||
|
is-plain-object "^5.0.0"
|
||||||
|
node-fetch "^2.6.7"
|
||||||
|
universal-user-agent "^6.0.0"
|
||||||
|
|
||||||
"@octokit/request@^6.0.0":
|
"@octokit/request@^6.0.0":
|
||||||
version "6.2.8"
|
version "6.2.8"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.8.tgz#aaf480b32ab2b210e9dadd8271d187c93171d8eb"
|
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.8.tgz#aaf480b32ab2b210e9dadd8271d187c93171d8eb"
|
||||||
@ -759,6 +848,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@octokit/openapi-types" "^18.0.0"
|
"@octokit/openapi-types" "^18.0.0"
|
||||||
|
|
||||||
|
"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0":
|
||||||
|
version "6.41.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04"
|
||||||
|
integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==
|
||||||
|
dependencies:
|
||||||
|
"@octokit/openapi-types" "^12.11.0"
|
||||||
|
|
||||||
"@octokit/types@^9.0.0", "@octokit/types@^9.2.3":
|
"@octokit/types@^9.0.0", "@octokit/types@^9.2.3":
|
||||||
version "9.3.2"
|
version "9.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-9.3.2.tgz#3f5f89903b69f6a2d196d78ec35f888c0013cac5"
|
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-9.3.2.tgz#3f5f89903b69f6a2d196d78ec35f888c0013cac5"
|
||||||
@ -1437,7 +1533,7 @@ define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0:
|
|||||||
has-property-descriptors "^1.0.0"
|
has-property-descriptors "^1.0.0"
|
||||||
object-keys "^1.1.1"
|
object-keys "^1.1.1"
|
||||||
|
|
||||||
deprecation@^2.0.0:
|
deprecation@^2.0.0, deprecation@^2.3.1:
|
||||||
version "2.3.1"
|
version "2.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919"
|
resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919"
|
||||||
integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==
|
integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user