Merge pull request #94 from docker/dependabot/npm_and_yarn/actions/github-5.0.0

Bump @actions/github from 4.0.0 to 5.0.0
This commit is contained in:
CrazyMax 2021-05-25 02:09:27 +02:00 committed by GitHub
commit 84dbd57663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 669 additions and 347 deletions

View File

@ -1,10 +1,9 @@
import * as path from 'path'; import * as path from 'path';
import * as github from '../src/github'; import * as github from '../src/github';
import {ReposGetResponseData} from '@octokit/types';
jest.spyOn(github, 'repo').mockImplementation( jest.spyOn(github, 'repo').mockImplementation(
(): Promise<ReposGetResponseData> => { (): Promise<github.ReposGetResponseData> => {
return <Promise<ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json')); return <Promise<github.ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
} }
); );

View File

@ -6,11 +6,10 @@ import {getInputs, Inputs} from '../src/context';
import * as github from '../src/github'; import * as github from '../src/github';
import {Meta, Version} from '../src/meta'; import {Meta, Version} from '../src/meta';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
jest.spyOn(github, 'repo').mockImplementation( jest.spyOn(github, 'repo').mockImplementation(
(): Promise<ReposGetResponseData> => { (): Promise<github.ReposGetResponseData> => {
return <Promise<ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json')); return <Promise<github.ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
} }
); );

831
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.7", "@actions/core": "^1.2.7",
"@actions/github": "^4.0.0", "@actions/github": "^5.0.0",
"csv-parse": "^4.15.4", "csv-parse": "^4.15.4",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"moment": "^2.29.1", "moment": "^2.29.1",

View File

@ -1,18 +1,18 @@
import * as github from '@actions/github'; import * as github from '@actions/github';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types'; import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
export type ReposGetResponseData = OctoOpenApiTypes['schemas']['repository'];
export function context(): Context { export function context(): Context {
return github.context; return github.context;
} }
export async function repo(token: string): Promise<ReposGetResponseData> { export async function repo(token: string): Promise<ReposGetResponseData> {
const octokit = github.getOctokit(token); return github
const repo = await octokit.repos.get({ .getOctokit(token)
.rest.repos.get({
...github.context.repo ...github.context.repo
}); })
if (!repo?.data) { .then(response => response.data as ReposGetResponseData);
throw new Error('Cannot get GitHub repository');
}
return repo.data;
} }

View File

@ -4,7 +4,6 @@ import * as github from './github';
import {Meta, Version} from './meta'; import {Meta, Version} from './meta';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
async function run() { async function run() {
try { try {
@ -14,7 +13,7 @@ async function run() {
} }
const context: Context = github.context(); const context: Context = github.context();
const repo: ReposGetResponseData = await github.repo(inputs.githubToken); const repo: github.ReposGetResponseData = await github.repo(inputs.githubToken);
core.startGroup(`Context info`); core.startGroup(`Context info`);
core.info(`eventName: ${context.eventName}`); core.info(`eventName: ${context.eventName}`);
core.info(`sha: ${context.sha}`); core.info(`sha: ${context.sha}`);

View File

@ -4,11 +4,11 @@ import * as path from 'path';
import moment from 'moment'; import moment from 'moment';
import * as semver from 'semver'; import * as semver from 'semver';
import {Inputs, tmpDir} from './context'; import {Inputs, tmpDir} from './context';
import {ReposGetResponseData} from './github';
import * as tcl from './tag'; import * as tcl from './tag';
import * as fcl from './flavor'; import * as fcl from './flavor';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
export interface Version { export interface Version {
main: string | undefined; main: string | undefined;

130
yarn.lock
View File

@ -7,20 +7,20 @@
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.7.tgz#594f8c45b213f0146e4be7eda8ae5cf4e198e5ab" resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.7.tgz#594f8c45b213f0146e4be7eda8ae5cf4e198e5ab"
integrity sha512-kzLFD5BgEvq6ubcxdgPbRKGD2Qrgya/5j+wh4LZzqT915I0V3rED+MvjH6NXghbvk1MXknpNNQ3uKjXSEN00Ig== integrity sha512-kzLFD5BgEvq6ubcxdgPbRKGD2Qrgya/5j+wh4LZzqT915I0V3rED+MvjH6NXghbvk1MXknpNNQ3uKjXSEN00Ig==
"@actions/github@^4.0.0": "@actions/github@^5.0.0":
version "4.0.0" version "5.0.0"
resolved "https://registry.yarnpkg.com/@actions/github/-/github-4.0.0.tgz#d520483151a2bf5d2dc9cd0f20f9ac3a2e458816" resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.0.0.tgz#1754127976c50bd88b2e905f10d204d76d1472f8"
integrity sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA== integrity sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==
dependencies: dependencies:
"@actions/http-client" "^1.0.8" "@actions/http-client" "^1.0.11"
"@octokit/core" "^3.0.0" "@octokit/core" "^3.4.0"
"@octokit/plugin-paginate-rest" "^2.2.3" "@octokit/plugin-paginate-rest" "^2.13.3"
"@octokit/plugin-rest-endpoint-methods" "^4.0.0" "@octokit/plugin-rest-endpoint-methods" "^5.1.1"
"@actions/http-client@^1.0.8": "@actions/http-client@^1.0.11":
version "1.0.9" version "1.0.11"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.9.tgz#af1947d020043dbc6a3b4c5918892095c30ffb52" resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0"
integrity sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg== integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==
dependencies: dependencies:
tunnel "0.0.6" tunnel "0.0.6"
@ -486,23 +486,24 @@
"@types/yargs" "^15.0.0" "@types/yargs" "^15.0.0"
chalk "^4.0.0" chalk "^4.0.0"
"@octokit/auth-token@^2.4.0": "@octokit/auth-token@^2.4.4":
version "2.4.2" version "2.4.5"
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.2.tgz#10d0ae979b100fa6b72fa0e8e63e27e6d0dbff8a" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.5.tgz#568ccfb8cb46f36441fac094ce34f7a875b197f3"
integrity sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ== integrity sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==
dependencies: dependencies:
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.3"
"@octokit/core@^3.0.0": "@octokit/core@^3.4.0":
version "3.1.4" version "3.4.0"
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.1.4.tgz#9c51a3d77bad7d8aa5ec0e997ee90da224206b5e" resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.4.0.tgz#b48aa27d755b339fe7550548b340dcc2b513b742"
integrity sha512-eNDwFpKbGbLzPXiFE5PCoeq3nHlKTmWcCtZfQNCwJmW21XqrWr6c2uUhgLCzDeDkQVvKqUWaIgeCDB6i6mvFoA== integrity sha512-6/vlKPP8NF17cgYXqucdshWqmMZGXkuvtcrWCgU5NOI0Pl2GjlmZyWgBMrU8zJ3v2MJlM6++CiB45VKYmhiWWg==
dependencies: dependencies:
"@octokit/auth-token" "^2.4.0" "@octokit/auth-token" "^2.4.4"
"@octokit/graphql" "^4.3.1" "@octokit/graphql" "^4.5.8"
"@octokit/request" "^5.4.0" "@octokit/request" "^5.4.12"
"@octokit/types" "^5.0.0" "@octokit/request-error" "^2.0.5"
before-after-hook "^2.1.0" "@octokit/types" "^6.0.3"
before-after-hook "^2.2.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/endpoint@^6.0.1": "@octokit/endpoint@^6.0.1":
@ -514,28 +515,33 @@
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.3.1": "@octokit/graphql@^4.5.8":
version "4.5.6" version "4.6.2"
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.5.6.tgz#708143ba15cf7c1879ed6188266e7f270be805d4" resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.2.tgz#ec44abdfa87f2b9233282136ae33e4ba446a04e7"
integrity sha512-Rry+unqKTa3svswT2ZAuqenpLrzJd+JTv89LTeVa5UM/5OX8o4KTkPL7/1ABq4f/ZkELb0XEK/2IEoYwykcLXg== integrity sha512-WmsIR1OzOr/3IqfG9JIczI8gMJUMzzyx5j0XXQ4YihHtKlQc+u35VpVoOXhlKAlaBntvry1WpAzPl/a+s3n89Q==
dependencies: dependencies:
"@octokit/request" "^5.3.0" "@octokit/request" "^5.3.0"
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.3"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/plugin-paginate-rest@^2.2.3": "@octokit/openapi-types@^7.2.0":
version "2.4.0" version "7.2.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.4.0.tgz#92f951ddc8a1cd505353fa07650752ca25ed7e93" resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.2.1.tgz#3ba1abe8906863edd403e185bc12e2bf79b3e240"
integrity sha512-YT6Klz3LLH6/nNgi0pheJnUmTFW4kVnxGft+v8Itc41IIcjl7y1C8TatmKQBbCSuTSNFXO5pCENnqg6sjwpJhg== integrity sha512-IHQJpLciwzwDvciLxiFj3IEV5VYn7lSVcj5cu0jbTwMfK4IG6/g8SPrVp3Le1VRzIiYSRcBzm1dA7vgWelYP3Q==
dependencies:
"@octokit/types" "^5.5.0"
"@octokit/plugin-rest-endpoint-methods@^4.0.0": "@octokit/plugin-paginate-rest@^2.13.3":
version "4.2.0" version "2.13.3"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.0.tgz#c5a0691b3aba5d8b4ef5dffd6af3649608f167ba" resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.3.tgz#f0f1792230805108762d87906fb02d573b9e070a"
integrity sha512-1/qn1q1C1hGz6W/iEDm9DoyNoG/xdFDt78E3eZ5hHeUfJTLJgyAMdj9chL/cNBHjcjd+FH5aO1x0VCqR2RE0mw== integrity sha512-46lptzM9lTeSmIBt/sVP/FLSTPGx6DCzAdSX3PfeJ3mTf4h9sGC26WpaQzMEq/Z44cOcmx8VsOhO+uEgE3cjYg==
dependencies: dependencies:
"@octokit/types" "^5.5.0" "@octokit/types" "^6.11.0"
"@octokit/plugin-rest-endpoint-methods@^5.1.1":
version "5.3.0"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.0.tgz#bcc8b4432ee24b30d6a4934c9e2baacda46a5aaf"
integrity sha512-+4NAJ9WzPN5gW6W1H1tblw/DesTD6PaWuU5+/x3Pa7nyK6qjR6cn4jwkJtzxVPTgtzryOFLX+5vs7MROFswp5Q==
dependencies:
"@octokit/types" "^6.16.0"
deprecation "^2.3.1" deprecation "^2.3.1"
"@octokit/request-error@^2.0.0": "@octokit/request-error@^2.0.0":
@ -547,7 +553,16 @@
deprecation "^2.0.0" deprecation "^2.0.0"
once "^1.4.0" once "^1.4.0"
"@octokit/request@^5.3.0", "@octokit/request@^5.4.0": "@octokit/request-error@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.5.tgz#72cc91edc870281ad583a42619256b380c600143"
integrity sha512-T/2wcCFyM7SkXzNoyVNWjyVlUwBvW3igM3Btr/eKYiPmucXTtkxt2RBsf6gn3LTzaLSLTQtNmvg+dGsOxQrjZg==
dependencies:
"@octokit/types" "^6.0.3"
deprecation "^2.0.0"
once "^1.4.0"
"@octokit/request@^5.3.0":
version "5.4.9" version "5.4.9"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.9.tgz#0a46f11b82351b3416d3157261ad9b1558c43365" resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.9.tgz#0a46f11b82351b3416d3157261ad9b1558c43365"
integrity sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA== integrity sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==
@ -561,13 +576,32 @@
once "^1.4.0" once "^1.4.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.5.0": "@octokit/request@^5.4.12":
version "5.4.15"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.15.tgz#829da413dc7dd3aa5e2cdbb1c7d0ebe1f146a128"
integrity sha512-6UnZfZzLwNhdLRreOtTkT9n57ZwulCve8q3IT/Z477vThu6snfdkBuhxnChpOKNGxcQ71ow561Qoa6uqLdPtag==
dependencies:
"@octokit/endpoint" "^6.0.1"
"@octokit/request-error" "^2.0.0"
"@octokit/types" "^6.7.1"
is-plain-object "^5.0.0"
node-fetch "^2.6.1"
universal-user-agent "^6.0.0"
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1":
version "5.5.0" version "5.5.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b"
integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ== integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==
dependencies: dependencies:
"@types/node" ">= 8" "@types/node" ">= 8"
"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.16.0", "@octokit/types@^6.7.1":
version "6.16.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.16.0.tgz#15f71e391ca74e91a21b70e3a1b033c89625dca4"
integrity sha512-EktqSNq8EKXE82a7Vw33ozOEhFXIRik+rZHJTHAgVZRm/p2K5r5ecn5fVpRkLCm3CAVFwchRvt3yvtmfbt2LCQ==
dependencies:
"@octokit/openapi-types" "^7.2.0"
"@sinonjs/commons@^1.7.0": "@sinonjs/commons@^1.7.0":
version "1.8.1" version "1.8.1"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217"
@ -910,10 +944,10 @@ bcrypt-pbkdf@^1.0.0:
dependencies: dependencies:
tweetnacl "^0.14.3" tweetnacl "^0.14.3"
before-after-hook@^2.1.0: before-after-hook@^2.2.0:
version "2.1.0" version "2.2.1"
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.1.tgz#73540563558687586b52ed217dad6a802ab1549c"
integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== integrity sha512-/6FKxSTWoJdbsLDF8tdIjaRiFXiE6UHsEHE3OPI/cwPURCVi1ukP0gmLn7XWEiFk5TcwQjjY5PWsU+j+tgXgmw==
brace-expansion@^1.1.7: brace-expansion@^1.1.7:
version "1.1.11" version "1.1.11"