mirror of
https://github.com/docker/metadata-action.git
synced 2026-03-06 08:13:07 +08:00
Merge pull request #604 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.77.0
Some checks failed
ci / context (git) (push) Has been cancelled
ci / context (workflow) (push) Has been cancelled
ci / multi-images (push) Has been cancelled
ci / tag-schedule () (push) Has been cancelled
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Has been cancelled
ci / tag-schedule (schedule) (push) Has been cancelled
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Has been cancelled
ci / tag-match (\d.\d, 0) (push) Has been cancelled
ci / tag-match (\d.\d.\d, 0) (push) Has been cancelled
ci / tag-match (v(.*), 1) (push) Has been cancelled
ci / tag-semver (auto) (push) Has been cancelled
ci / tag-semver (false) (push) Has been cancelled
ci / tag-semver (true) (push) Has been cancelled
ci / flavor (push) Has been cancelled
ci / images (push) Has been cancelled
ci / custom-labels-annotations (push) Has been cancelled
ci / global-exps (push) Has been cancelled
ci / json (push) Has been cancelled
ci / docker-push (push) Has been cancelled
ci / bake (push) Has been cancelled
ci / sep-tags ( ) (push) Has been cancelled
ci / sep-tags (,) (push) Has been cancelled
ci / output-env (push) Has been cancelled
ci / no-output-env (push) Has been cancelled
ci / bake-annotations (push) Has been cancelled
ci / no-images (push) Has been cancelled
ci / bake-path-context (push) Has been cancelled
ci / sha-short () (push) Has been cancelled
ci / sha-short (16) (push) Has been cancelled
ci / dump (push) Has been cancelled
test / test (push) Has been cancelled
validate / prepare (push) Has been cancelled
validate / validate (push) Has been cancelled
Some checks failed
ci / context (git) (push) Has been cancelled
ci / context (workflow) (push) Has been cancelled
ci / multi-images (push) Has been cancelled
ci / tag-schedule () (push) Has been cancelled
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Has been cancelled
ci / tag-schedule (schedule) (push) Has been cancelled
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Has been cancelled
ci / tag-match (\d.\d, 0) (push) Has been cancelled
ci / tag-match (\d.\d.\d, 0) (push) Has been cancelled
ci / tag-match (v(.*), 1) (push) Has been cancelled
ci / tag-semver (auto) (push) Has been cancelled
ci / tag-semver (false) (push) Has been cancelled
ci / tag-semver (true) (push) Has been cancelled
ci / flavor (push) Has been cancelled
ci / images (push) Has been cancelled
ci / custom-labels-annotations (push) Has been cancelled
ci / global-exps (push) Has been cancelled
ci / json (push) Has been cancelled
ci / docker-push (push) Has been cancelled
ci / bake (push) Has been cancelled
ci / sep-tags ( ) (push) Has been cancelled
ci / sep-tags (,) (push) Has been cancelled
ci / output-env (push) Has been cancelled
ci / no-output-env (push) Has been cancelled
ci / bake-annotations (push) Has been cancelled
ci / no-images (push) Has been cancelled
ci / bake-path-context (push) Has been cancelled
ci / sha-short () (push) Has been cancelled
ci / sha-short (16) (push) Has been cancelled
ci / dump (push) Has been cancelled
test / test (push) Has been cancelled
validate / prepare (push) Has been cancelled
validate / validate (push) Has been cancelled
chore(deps): Bump @docker/actions-toolkit from 0.68.0 to 0.79.0
This commit is contained in:
commit
7b19fec715
@ -3,9 +3,9 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as dotenv from 'dotenv';
|
||||
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github.js';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github/github.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github.js';
|
||||
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github/github.js';
|
||||
|
||||
import {ContextSource, getContext, getInputs, Inputs} from '../src/context.js';
|
||||
import type {Context as MetadataContext} from '../src/context.js';
|
||||
|
||||
@ -1,32 +1,11 @@
|
||||
import fs from 'node:fs';
|
||||
import {createRequire} from 'node:module';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import {vi} from 'vitest';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-'));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/metadata-action',
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
});
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
type RequireCacheEntry = NonNullable<(typeof require.cache)[string]>;
|
||||
|
||||
const githubMock = {
|
||||
context: {
|
||||
repo: {
|
||||
owner: 'docker',
|
||||
repo: 'actions-toolkit'
|
||||
},
|
||||
ref: 'refs/heads/dev',
|
||||
sha: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
runId: 2188748038,
|
||||
runNumber: 15,
|
||||
payload: {
|
||||
const githubPayload = {
|
||||
after: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
base_ref: null,
|
||||
before: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
@ -43,11 +22,11 @@ const githubMock = {
|
||||
username: 'crazy-max'
|
||||
},
|
||||
distinct: true,
|
||||
id: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
id: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
message: 'hello dev',
|
||||
timestamp: '2022-04-19T11:27:24+02:00',
|
||||
timestamp: '2024-11-13T13:42:28Z',
|
||||
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
|
||||
url: 'https://github.com/docker/test-docker-action/commit/860c1904a1ce19322e91ac35af1ab07466440c37'
|
||||
url: 'https://github.com/docker/test-docker-action/commit/5f3331d7f7044c18ca9f12c77d961c4d7cf3276a'
|
||||
}
|
||||
],
|
||||
compare: 'https://github.com/docker/test-docker-action/compare/5f3331d7f704...860c1904a1ce',
|
||||
@ -66,11 +45,11 @@ const githubMock = {
|
||||
username: 'crazy-max'
|
||||
},
|
||||
distinct: true,
|
||||
id: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
id: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
message: 'hello dev',
|
||||
timestamp: '2022-04-19T11:27:24+02:00',
|
||||
timestamp: '2024-11-13T13:42:28Z',
|
||||
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
|
||||
url: 'https://github.com/docker/test-docker-action/commit/860c1904a1ce19322e91ac35af1ab07466440c37'
|
||||
url: 'https://github.com/docker/test-docker-action/commit/5f3331d7f7044c18ca9f12c77d961c4d7cf3276a'
|
||||
},
|
||||
organization: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
|
||||
@ -220,12 +199,26 @@ const githubMock = {
|
||||
type: 'User',
|
||||
url: 'https://api.github.com/users/crazy-max'
|
||||
}
|
||||
}
|
||||
},
|
||||
getOctokit: () => ({
|
||||
rest: {
|
||||
repos: {
|
||||
getCommit: async () => ({
|
||||
};
|
||||
|
||||
const githubEventPath = path.join(tmpDir, 'github-event.json');
|
||||
fs.writeFileSync(githubEventPath, JSON.stringify(githubPayload));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/metadata-action',
|
||||
GITHUB_REF: 'refs/heads/dev',
|
||||
GITHUB_RUN_ID: '2188748038',
|
||||
GITHUB_RUN_ATTEMPT: '1',
|
||||
GITHUB_RUN_NUMBER: '15',
|
||||
GITHUB_SHA: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
GITHUB_EVENT_PATH: githubEventPath,
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
});
|
||||
|
||||
const getCommitMock = vi.hoisted(() =>
|
||||
vi.fn(async () => ({
|
||||
data: {
|
||||
commit: {
|
||||
committer: {
|
||||
@ -233,27 +226,27 @@ const githubMock = {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}))
|
||||
);
|
||||
|
||||
const getOctokitMock = vi.hoisted(() =>
|
||||
vi.fn(() => ({
|
||||
rest: {
|
||||
repos: {
|
||||
getCommit: getCommitMock
|
||||
}
|
||||
}
|
||||
})
|
||||
}))
|
||||
);
|
||||
|
||||
vi.mock('@actions/github', async importOriginal => {
|
||||
const actual = await importOriginal<typeof import('@actions/github')>();
|
||||
return {
|
||||
...actual,
|
||||
context: {
|
||||
...actual.context,
|
||||
payload: githubPayload
|
||||
},
|
||||
getOctokit: getOctokitMock
|
||||
};
|
||||
|
||||
vi.mock('@actions/github', () => githubMock);
|
||||
|
||||
for (const mod of ['@actions/github', '@docker/actions-toolkit/node_modules/@actions/github']) {
|
||||
try {
|
||||
const resolved = require.resolve(mod);
|
||||
vi.doMock(resolved, () => githubMock);
|
||||
require.cache[resolved] = {
|
||||
id: resolved,
|
||||
filename: resolved,
|
||||
loaded: true,
|
||||
exports: githubMock,
|
||||
children: [],
|
||||
paths: []
|
||||
} as RequireCacheEntry;
|
||||
} catch {
|
||||
// Ignore unresolved optional paths; vi.mock handles module-level mocking.
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
145
dist/index.js
generated
vendored
145
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.0",
|
||||
"@actions/github": "^9.0.0",
|
||||
"@docker/actions-toolkit": "^0.68.0",
|
||||
"@docker/actions-toolkit": "^0.79.0",
|
||||
"@renovate/pep440": "^1.0.0",
|
||||
"csv-parse": "^6.1.0",
|
||||
"handlebars": "^4.7.8",
|
||||
|
||||
@ -2,7 +2,7 @@ import * as core from '@actions/core';
|
||||
|
||||
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||
import {Git} from '@docker/actions-toolkit/lib/git.js';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github.js';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github/github.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
|
||||
type GithubContext = typeof GitHub.context;
|
||||
|
||||
@ -6,7 +6,7 @@ import * as pep440 from '@renovate/pep440';
|
||||
import * as semver from 'semver';
|
||||
import * as core from '@actions/core';
|
||||
import {Context as ToolkitContext} from '@docker/actions-toolkit/lib/context.js';
|
||||
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github.js';
|
||||
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github/github.js';
|
||||
|
||||
import {Inputs, Context} from './context.js';
|
||||
import * as icl from './image.js';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user