Compare commits

..
Author SHA1 Message Date
dependabot[bot] 8d9a8ddd79 build(deps): bump the crazy-max-dot-github group across 1 directory with 3 updates
Bumps the crazy-max-dot-github group with 3 updates in the / directory: [crazy-max/.github/.github/actions/install-k3s](https://github.com/crazy-max/.github), [crazy-max/.github/.github/workflows/pr-assign-author.yml](https://github.com/crazy-max/.github) and [crazy-max/.github/.github/workflows/zizmor.yml](https://github.com/crazy-max/.github).


Updates `crazy-max/.github/.github/actions/install-k3s` from 1.10.1 to 1.11.0
- [Release notes](https://github.com/crazy-max/.github/releases)
- [Commits](https://github.com/crazy-max/.github/compare/46267a6e61cd56aac2fc79943df180152f4c89d6...f91220cba053bd54299ba645a599ee8ed436f222)

Updates `crazy-max/.github/.github/workflows/pr-assign-author.yml` from 1.10.1 to 1.11.0
- [Release notes](https://github.com/crazy-max/.github/releases)
- [Commits](https://github.com/crazy-max/.github/compare/46267a6e61cd56aac2fc79943df180152f4c89d6...f91220cba053bd54299ba645a599ee8ed436f222)

Updates `crazy-max/.github/.github/workflows/zizmor.yml` from 1.10.1 to 1.11.0
- [Release notes](https://github.com/crazy-max/.github/releases)
- [Commits](https://github.com/crazy-max/.github/compare/46267a6e61cd56aac2fc79943df180152f4c89d6...f91220cba053bd54299ba645a599ee8ed436f222)

---
updated-dependencies:
- dependency-name: crazy-max/.github/.github/actions/install-k3s
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: crazy-max-dot-github
- dependency-name: crazy-max/.github/.github/workflows/pr-assign-author.yml
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: crazy-max-dot-github
- dependency-name: crazy-max/.github/.github/workflows/zizmor.yml
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: crazy-max-dot-github
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-02 04:42:26 +00:00
8 changed files with 236 additions and 109 deletions
+1 -1
View File
@@ -488,7 +488,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- -
name: Install k3s name: Install k3s
uses: crazy-max/.github/.github/actions/install-k3s@46267a6e61cd56aac2fc79943df180152f4c89d6 # v1.10.1 uses: crazy-max/.github/.github/actions/install-k3s@f91220cba053bd54299ba645a599ee8ed436f222 # v1.11.0
- -
name: Set up Docker Buildx name: Set up Docker Buildx
id: buildx id: buildx
+1 -1
View File
@@ -11,7 +11,7 @@ on:
jobs: jobs:
run: run:
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@46267a6e61cd56aac2fc79943df180152f4c89d6 # v1.10.1 uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@f91220cba053bd54299ba645a599ee8ed436f222 # v1.11.0
permissions: permissions:
contents: read contents: read
pull-requests: write pull-requests: write
+1 -1
View File
@@ -19,7 +19,7 @@ on:
jobs: jobs:
zizmor: zizmor:
uses: crazy-max/.github/.github/workflows/zizmor.yml@46267a6e61cd56aac2fc79943df180152f4c89d6 # v1.10.1 uses: crazy-max/.github/.github/workflows/zizmor.yml@f91220cba053bd54299ba645a599ee8ed436f222 # v1.11.0
permissions: permissions:
contents: read contents: read
security-events: write security-events: write
+135 -20
View File
@@ -234,7 +234,7 @@ describe('getCreateArgs', () => {
], ],
[ [
10, 10,
'v0.37.0', 'v0.10.3',
new Map<string, string>([ new Map<string, string>([
['use', 'false'], ['use', 'false'],
['driver', 'cloud'], ['driver', 'cloud'],
@@ -301,25 +301,6 @@ describe('getCreateArgs', () => {
expect(res).toEqual(expected); expect(res).toEqual(expected);
} }
); );
test('rejects cloud driver with unsupported official Buildx', async () => {
setInput('version', 'v0.36.1');
setInput('driver', 'cloud');
setInput('use', 'true');
setInput('cache-binary', 'true');
setInput('cleanup', 'true');
setInput('keep-state', 'false');
const toolkit = new Toolkit();
const versionSpy = vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
return 'v0.36.1';
});
try {
const inp = await context.getInputs();
await expect(context.getCreateArgs(inp, toolkit)).rejects.toThrow(/requires Buildx v0.37.0 or later/);
} finally {
versionSpy.mockRestore();
}
});
}); });
describe('getAppendArgs', () => { describe('getAppendArgs', () => {
@@ -380,6 +361,140 @@ describe('getAppendArgs', () => {
); );
}); });
describe('getVersion', () => {
beforeEach(() => {
process.env = Object.keys(process.env).reduce((object, key) => {
if (!key.startsWith('INPUT_')) {
object[key] = process.env[key];
}
return object;
}, {});
});
// prettier-ignore
test.each([
[
0,
new Map<string, string>([
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
''
],
[
1,
new Map<string, string>([
['version', 'latest'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'latest'
],
[
2,
new Map<string, string>([
['version', 'edge'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'edge'
],
[
3,
new Map<string, string>([
['version', 'v0.19.2'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'v0.19.2'
],
[
4,
new Map<string, string>([
['version', 'latest'],
['driver', 'cloud'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'cloud:latest'
],
[
5,
new Map<string, string>([
['version', 'edge'],
['driver', 'cloud'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'cloud:edge'
],
[
6,
new Map<string, string>([
['driver', 'cloud'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'cloud:latest'
],
[
7,
new Map<string, string>([
['version', 'cloud:v0.11.2-desktop.2'],
['driver', 'cloud'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'cloud:v0.11.2-desktop.2'
],
[
8,
new Map<string, string>([
['version', 'cloud:v0.11.2-desktop.2'],
// defaults
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
['keep-state', 'false']
]),
'cloud:v0.11.2-desktop.2'
],
])(
'[%d] given %o as inputs, returns version %o',
async (num: number, inputs: Map<string, string>, expected: string) => {
inputs.forEach((value: string, name: string) => {
setInput(name, value);
});
const inp = await context.getInputs();
expect(context.getVersion(inp)).toEqual(expected);
}
);
});
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67 // See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
function getInputName(name: string): string { function getInputName(name: string): string {
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`; return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
Generated Vendored
+76 -76
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+3 -3
View File
File diff suppressed because one or more lines are too long
+14 -3
View File
@@ -52,9 +52,6 @@ export async function getBuilderName(name: string, driver: string): Promise<stri
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> { export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver]; const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
if (inputs.driver === 'cloud' && !inputs.version.startsWith('cloud:') && !inputs.version.startsWith('lab:') && !(await toolkit.buildx.versionSatisfies('>=0.37.0-0'))) {
throw new Error(`Docker Build Cloud with official Buildx requires Buildx v0.37.0 or later. Set version to cloud:<version> or lab:<version> to use the legacy Docker Build Cloud release channel.`);
}
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) { if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => { await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => {
args.push('--driver-opt', driverOpt); args.push('--driver-opt', driverOpt);
@@ -119,3 +116,17 @@ export async function getInspectArgs(inputs: Inputs, toolkit: Toolkit): Promise<
function driverSupportsBuildkitdFlags(driver: string): boolean { function driverSupportsBuildkitdFlags(driver: string): boolean {
return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes'; return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes';
} }
export function getVersion(inputs: Inputs): string {
const version = inputs.version;
if (inputs.driver === 'cloud') {
if (!version || version === 'latest') {
return 'cloud:latest';
}
if (version.startsWith('cloud:') || version.startsWith('lab:')) {
return version;
}
return `cloud:${version}`;
}
return version;
}
+5 -4
View File
@@ -22,6 +22,7 @@ actionsToolkit.run(
async () => { async () => {
const inputs: context.Inputs = await context.getInputs(); const inputs: context.Inputs = await context.getInputs();
stateHelper.setCleanup(inputs.cleanup); stateHelper.setCleanup(inputs.cleanup);
const version = context.getVersion(inputs);
const toolkit = new Toolkit(); const toolkit = new Toolkit();
const standalone = await toolkit.buildx.isStandalone(); const standalone = await toolkit.buildx.isStandalone();
@@ -43,17 +44,17 @@ actionsToolkit.run(
}); });
let toolPath; let toolPath;
if (Util.isValidRef(inputs.version)) { if (Util.isValidRef(version)) {
if (standalone) { if (standalone) {
throw new Error(`Cannot build from source without the Docker CLI`); throw new Error(`Cannot build from source without the Docker CLI`);
} }
await core.group(`Build buildx from source`, async () => { await core.group(`Build buildx from source`, async () => {
toolPath = await toolkit.buildxInstall.build(inputs.version, !inputs.cacheBinary); toolPath = await toolkit.buildxInstall.build(version, !inputs.cacheBinary);
}); });
} else if (!(await toolkit.buildx.isAvailable()) || inputs.version || (inputs.driver === 'cloud' && !inputs.version && !(await toolkit.buildx.versionSatisfies('>=0.37.0-0')))) { } else if (!(await toolkit.buildx.isAvailable()) || version) {
await core.group(`Download buildx from GitHub Releases`, async () => { await core.group(`Download buildx from GitHub Releases`, async () => {
toolPath = await toolkit.buildxInstall.download({ toolPath = await toolkit.buildxInstall.download({
version: inputs.version || 'latest', version: version || 'latest',
ghaNoCache: !inputs.cacheBinary ghaNoCache: !inputs.cacheBinary
}); });
}); });