Compare commits

...

14 Commits

Author SHA1 Message Date
CrazyMax
3f1544eb9e
Merge pull request #139 from hashhar/hashhar/cleanup-aliases
Some checks failed
ci / debug (push) Failing after 0s
ci / install (push) Failing after 0s
ci / use (false) (push) Failing after 0s
ci / use (true) (push) Failing after 0s
ci / driver (image=moby/buildkit:latest) (push) Failing after 0s
ci / driver (image=moby/buildkit:master network=host ) (push) Failing after 0s
ci / docker-driver (push) Failing after 0s
ci / endpoint (push) Failing after 0s
ci / config (push) Failing after 0s
ci / config-inline (push) Failing after 0s
ci / with-qemu (, all) (push) Failing after 0s
ci / with-qemu (, arm64,riscv64,arm) (push) Failing after 0s
ci / with-qemu (v0.9.1, all) (push) Failing after 0s
ci / with-qemu (v0.9.1, arm64,riscv64,arm) (push) Failing after 0s
ci / build-ref (cb185f095fd3d9444e0aa605d3789e9e05f2a1e7) (push) Failing after 0s
ci / build-ref (master) (push) Failing after 0s
ci / build-ref (refs/pull/731/head) (push) Failing after 0s
ci / build-ref (refs/tags/v0.5.1) (push) Failing after 0s
ci / standalone-cmd (push) Failing after 0s
ci / standalone-action (push) Failing after 0s
ci / standalone-install-error (push) Failing after 0s
ci / append (push) Failing after 0s
ci / platforms (push) Failing after 0s
ci / docker-context (push) Failing after 0s
ci / cleanup (false) (push) Failing after 0s
ci / cleanup (true) (push) Failing after 0s
ci / k3s (v0.10.5) (push) Failing after 0s
ci / k3s (v0.11.0) (push) Failing after 0s
ci / cache-binary (false) (push) Failing after 0s
ci / cache-binary (true) (push) Failing after 0s
Remove aliases created by buildx when installing by default
2025-05-21 12:04:20 +02:00
CrazyMax
f3204bbfac
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-05-21 12:01:07 +02:00
Ashhar Hasan
4ba329ef89
Remove aliases created by buildx when installing by default
If the action is configured to install buildx by default using the
input then docker buildx sets up docker build as an alias for buildx
making all docker build calls use the buildx builder instead of
traditional builders. The action didn't perform cleanup in this case to
uninstall the aliases which meant that any future workflows running on
same GitHub Actions runner would get the buildx builders even if it did
not explicitly request it.

This commit tracks if the aliases were installed and removes them during
post step of the action if so.

Signed-off-by: Ashhar Hasan <hashhar_dev@outlook.com>
2025-05-21 11:59:28 +02:00
CrazyMax
e600775e52
Merge pull request #422 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.61.0
Some checks failed
ci / debug (push) Failing after 0s
ci / install (push) Failing after 0s
ci / use (false) (push) Failing after 0s
ci / use (true) (push) Failing after 0s
ci / driver (image=moby/buildkit:latest) (push) Failing after 0s
ci / driver (image=moby/buildkit:master network=host ) (push) Failing after 0s
ci / docker-driver (push) Failing after 1s
ci / endpoint (push) Failing after 1s
ci / config (push) Failing after 0s
ci / config-inline (push) Failing after 1s
ci / with-qemu (, all) (push) Failing after 0s
ci / with-qemu (, arm64,riscv64,arm) (push) Failing after 1s
ci / with-qemu (v0.9.1, all) (push) Failing after 0s
ci / with-qemu (v0.9.1, arm64,riscv64,arm) (push) Failing after 1s
ci / build-ref (cb185f095fd3d9444e0aa605d3789e9e05f2a1e7) (push) Failing after 1s
ci / build-ref (master) (push) Failing after 0s
ci / build-ref (refs/pull/731/head) (push) Failing after 0s
ci / build-ref (refs/tags/v0.5.1) (push) Failing after 1s
ci / standalone-cmd (push) Failing after 0s
ci / standalone-action (push) Failing after 0s
ci / standalone-install-error (push) Failing after 0s
ci / append (push) Failing after 0s
ci / platforms (push) Failing after 1s
ci / docker-context (push) Failing after 0s
ci / cleanup (false) (push) Failing after 0s
ci / cleanup (true) (push) Failing after 1s
ci / k3s (v0.10.5) (push) Failing after 0s
ci / k3s (v0.11.0) (push) Failing after 0s
ci / cache-binary (false) (push) Failing after 0s
ci / cache-binary (true) (push) Failing after 1s
build(deps): bump @docker/actions-toolkit from 0.56.0 to 0.61.0
2025-04-24 11:30:53 +02:00
CrazyMax
b2b2ffa946
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-04-24 11:22:25 +02:00
dependabot[bot]
fe905840cd
build(deps): bump @docker/actions-toolkit from 0.56.0 to 0.61.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.56.0 to 0.61.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.56.0...v0.61.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-version: 0.61.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-24 09:02:39 +00:00
CrazyMax
8998bbe94b
Merge pull request #420 from crazy-max/pr-assign-author
Some checks failed
ci / debug (push) Failing after 1s
ci / install (push) Failing after 1s
ci / use (false) (push) Failing after 1s
ci / use (true) (push) Failing after 1s
ci / driver (image=moby/buildkit:latest) (push) Failing after 1s
ci / driver (image=moby/buildkit:master network=host ) (push) Failing after 1s
ci / docker-driver (push) Failing after 1s
ci / endpoint (push) Failing after 1s
ci / config (push) Failing after 1s
ci / config-inline (push) Failing after 1s
ci / with-qemu (, all) (push) Failing after 1s
ci / with-qemu (, arm64,riscv64,arm) (push) Failing after 1s
ci / with-qemu (v0.9.1, all) (push) Failing after 1s
ci / with-qemu (v0.9.1, arm64,riscv64,arm) (push) Failing after 1s
ci / build-ref (cb185f095fd3d9444e0aa605d3789e9e05f2a1e7) (push) Failing after 1s
ci / build-ref (master) (push) Failing after 1s
ci / build-ref (refs/pull/731/head) (push) Failing after 1s
ci / build-ref (refs/tags/v0.5.1) (push) Failing after 1s
ci / standalone-cmd (push) Failing after 1s
ci / standalone-action (push) Failing after 1s
ci / standalone-install-error (push) Failing after 1s
ci / append (push) Failing after 1s
ci / platforms (push) Failing after 1s
ci / docker-context (push) Failing after 1s
ci / cleanup (false) (push) Failing after 0s
ci / cleanup (true) (push) Failing after 1s
ci / k3s (v0.10.5) (push) Failing after 0s
ci / k3s (v0.11.0) (push) Failing after 1s
ci / cache-binary (false) (push) Failing after 1s
ci / cache-binary (true) (push) Failing after 1s
pr-assign-author workflow
2025-04-23 16:10:00 +02:00
CrazyMax
830833e0c7
pr-assign-author workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-04-23 14:18:49 +02:00
CrazyMax
941183f0a0
Merge pull request #413 from crazy-max/ci-dispatch
Some checks failed
ci / debug (push) Failing after 0s
ci / install (push) Failing after 0s
ci / use (false) (push) Failing after 0s
ci / use (true) (push) Failing after 0s
ci / driver (image=moby/buildkit:latest) (push) Failing after 0s
ci / driver (image=moby/buildkit:master network=host ) (push) Failing after 0s
ci / docker-driver (push) Failing after 0s
ci / endpoint (push) Failing after 0s
ci / config (push) Failing after 0s
ci / config-inline (push) Failing after 0s
ci / with-qemu (, all) (push) Failing after 0s
ci / with-qemu (, arm64,riscv64,arm) (push) Failing after 0s
ci / with-qemu (v0.9.1, all) (push) Failing after 0s
ci / with-qemu (v0.9.1, arm64,riscv64,arm) (push) Failing after 0s
ci / build-ref (cb185f095fd3d9444e0aa605d3789e9e05f2a1e7) (push) Failing after 0s
ci / build-ref (master) (push) Failing after 0s
ci / build-ref (refs/pull/731/head) (push) Failing after 0s
ci / build-ref (refs/tags/v0.5.1) (push) Failing after 0s
ci / standalone-cmd (push) Failing after 0s
ci / standalone-action (push) Failing after 0s
ci / standalone-install-error (push) Failing after 0s
ci / append (push) Failing after 0s
ci / platforms (push) Failing after 0s
ci / docker-context (push) Failing after 0s
ci / cleanup (false) (push) Failing after 0s
ci / cleanup (true) (push) Failing after 0s
ci / k3s (v0.10.5) (push) Failing after 0s
ci / k3s (v0.11.0) (push) Failing after 0s
ci / cache-binary (false) (push) Failing after 0s
ci / cache-binary (true) (push) Failing after 0s
ci: add workflow_dispatch event
2025-03-28 10:00:25 +01:00
CrazyMax
311b62b254
ci: add workflow_dispatch event
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-18 15:39:20 +01:00
CrazyMax
afeb29a6e0
Merge pull request #411 from crazy-max/test-windows
Some checks failed
ci / install (push) Failing after 1s
ci / use (false) (push) Failing after 2s
ci / use (true) (push) Failing after 1s
ci / driver (image=moby/buildkit:latest) (push) Failing after 1s
ci / driver (image=moby/buildkit:master network=host ) (push) Failing after 0s
ci / docker-driver (push) Failing after 2s
ci / endpoint (push) Failing after 0s
ci / config (push) Failing after 1s
ci / config-inline (push) Failing after 1s
ci / with-qemu (, all) (push) Failing after 2s
ci / with-qemu (, arm64,riscv64,arm) (push) Failing after 0s
ci / with-qemu (v0.9.1, all) (push) Failing after 0s
ci / with-qemu (v0.9.1, arm64,riscv64,arm) (push) Failing after 0s
ci / build-ref (cb185f095fd3d9444e0aa605d3789e9e05f2a1e7) (push) Failing after 0s
ci / build-ref (master) (push) Failing after 1s
ci / build-ref (refs/pull/731/head) (push) Failing after 0s
ci / build-ref (refs/tags/v0.5.1) (push) Failing after 1s
ci / standalone-cmd (push) Failing after 1s
ci / standalone-action (push) Failing after 0s
ci / standalone-install-error (push) Failing after 1s
ci / append (push) Failing after 1s
ci / platforms (push) Failing after 0s
ci / docker-context (push) Failing after 1s
ci / cleanup (false) (push) Failing after 1s
ci / cleanup (true) (push) Failing after 0s
ci / k3s (v0.10.5) (push) Failing after 1s
ci / k3s (v0.11.0) (push) Failing after 0s
ci / cache-binary (false) (push) Failing after 2s
ci / cache-binary (true) (push) Failing after 1s
ci / windows-error (push) Has been cancelled
ci: test container builder on windows
2025-03-12 15:56:50 +01:00
CrazyMax
b560416601
Merge pull request #412 from crazy-max/ci-bump-ubuntu
ci: bump to ubuntu-latest
2025-03-12 15:56:34 +01:00
CrazyMax
516bb780e5
ci: bump to ubuntu-latest
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-12 15:49:49 +01:00
CrazyMax
11445527f0
ci: test container builder on windows
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-12 15:44:27 +01:00
8 changed files with 86 additions and 31 deletions

View File

@ -5,6 +5,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
on: on:
workflow_dispatch:
schedule: schedule:
- cron: '0 10 * * *' - cron: '0 10 * * *'
push: push:
@ -516,7 +517,7 @@ jobs:
cleanup: ${{ matrix.cleanup }} cleanup: ${{ matrix.cleanup }}
k3s: k3s:
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -529,9 +530,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- -
name: Install k3s name: Install k3s
uses: crazy-max/.github/.github/actions/install-k3s@605d30d5ae97f6680578ace4b56645af79343e60 uses: crazy-max/.github/.github/actions/install-k3s@f5cb4a109b7a3b466a2ac293ef4bb13f1571acd7
with:
version: "v1.21.2-k3s1"
- -
name: Set up Docker Buildx name: Set up Docker Buildx
id: buildx id: buildx
@ -583,3 +582,24 @@ jobs:
with: with:
version: v0.11.2 version: v0.11.2
cache-binary: ${{ matrix.cache }} cache-binary: ${{ matrix.cache }}
windows-error:
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
id: buildx
continue-on-error: true
uses: ./
-
name: Check
run: |
echo "${{ toJson(steps.buildx) }}"
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
echo "::error::Should have failed"
exit 1
fi
shell: bash

17
.github/workflows/pr-assign-author.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: pr-assign-author
permissions:
contents: read
on:
pull_request_target:
types:
- opened
- reopened
jobs:
run:
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
permissions:
contents: read
pull-requests: write

20
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,7 @@
"packageManager": "yarn@3.6.3", "packageManager": "yarn@3.6.3",
"dependencies": { "dependencies": {
"@actions/core": "^1.11.1", "@actions/core": "^1.11.1",
"@docker/actions-toolkit": "^0.56.0", "@docker/actions-toolkit": "^0.61.0",
"js-yaml": "^4.1.0" "js-yaml": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -179,6 +179,7 @@ actionsToolkit.run(
throw new Error(`Cannot set buildx as default builder without the Docker CLI`); throw new Error(`Cannot set buildx as default builder without the Docker CLI`);
} }
await core.group(`Setting buildx as default builder`, async () => { await core.group(`Setting buildx as default builder`, async () => {
stateHelper.setBuildxIsDefaultBuilder(true);
const installCmd = await toolkit.buildx.getCommand(['install']); const installCmd = await toolkit.buildx.getCommand(['install']);
await Exec.getExecOutput(installCmd.command, installCmd.args, { await Exec.getExecOutput(installCmd.command, installCmd.args, {
ignoreReturnCode: true ignoreReturnCode: true
@ -279,5 +280,17 @@ actionsToolkit.run(
fs.rmSync(stateHelper.certsDir, {recursive: true}); fs.rmSync(stateHelper.certsDir, {recursive: true});
}); });
} }
if (stateHelper.buildxIsDefaultBuilder) {
await core.group(`Restoring default builder`, async () => {
await Exec.getExecOutput('docker', ['buildx', 'uninstall'], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(`${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
}
});
});
}
} }
); );

View File

@ -8,6 +8,7 @@ export const containerName = process.env['STATE_containerName'] || '';
export const certsDir = process.env['STATE_certsDir'] || ''; export const certsDir = process.env['STATE_certsDir'] || '';
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || ''; export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || ''); export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
export const buildxIsDefaultBuilder = /true/i.test(process.env['STATE_buildxIsDefaultBuilder'] || '');
export function setDebug(debug: string) { export function setDebug(debug: string) {
core.saveState('isDebug', debug); core.saveState('isDebug', debug);
@ -40,3 +41,7 @@ export function setTmpDockerContext(tmpDockerContext: string) {
export function setCleanup(cleanup: boolean) { export function setCleanup(cleanup: boolean) {
core.saveState('cleanup', cleanup); core.saveState('cleanup', cleanup);
} }
export function setBuildxIsDefaultBuilder(buildxIsDefaultBuilder: boolean) {
core.saveState('buildxIsDefaultBuilder', buildxIsDefaultBuilder);
}

View File

@ -12,9 +12,9 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@actions/artifact@npm:^2.2.2": "@actions/artifact@npm:^2.3.2":
version: 2.2.2 version: 2.3.2
resolution: "@actions/artifact@npm:2.2.2" resolution: "@actions/artifact@npm:2.3.2"
dependencies: dependencies:
"@actions/core": ^1.10.0 "@actions/core": ^1.10.0
"@actions/github": ^5.1.1 "@actions/github": ^5.1.1
@ -28,13 +28,13 @@ __metadata:
archiver: ^7.0.1 archiver: ^7.0.1
jwt-decode: ^3.1.2 jwt-decode: ^3.1.2
unzip-stream: ^0.3.1 unzip-stream: ^0.3.1
checksum: 1501b3d0ceb671f370786ccf70014de9586c5a78c95d235248fc16c73bf928f8de2aa932a679258f6d9bc2f2e570648d830551af9f063298f05d19f3330b33bc checksum: 78ee41b43800accb2f3527e1733217c43d53693e7f96ce2470b16890fb84f5c2ebaaa6048ccdb6cfe188b54c02779ec99623c6932558e757f6829cfde203cf2c
languageName: node languageName: node
linkType: hard linkType: hard
"@actions/cache@npm:^4.0.2": "@actions/cache@npm:^4.0.3":
version: 4.0.2 version: 4.0.3
resolution: "@actions/cache@npm:4.0.2" resolution: "@actions/cache@npm:4.0.3"
dependencies: dependencies:
"@actions/core": ^1.11.1 "@actions/core": ^1.11.1
"@actions/exec": ^1.0.1 "@actions/exec": ^1.0.1
@ -46,7 +46,7 @@ __metadata:
"@azure/storage-blob": ^12.13.0 "@azure/storage-blob": ^12.13.0
"@protobuf-ts/plugin": ^2.9.4 "@protobuf-ts/plugin": ^2.9.4
semver: ^6.3.1 semver: ^6.3.1
checksum: 208f11238a26194f331b329bb99d50a87c1a3ccef1dbae181e5c142b3faf41715203e0c5cbc491519d3d97540a68fbd418c25fb6e16caabf76248c40867c02b4 checksum: ee9c2a21a70bd3f35c63f302af478e23f135c26deb77ea2e4eed29c62766a4b201fc7435651c0d56fa504c02d203107e3bdfda1dba18a3ee09338e1dfc3f2fe8
languageName: node languageName: node
linkType: hard linkType: hard
@ -1088,12 +1088,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@docker/actions-toolkit@npm:^0.56.0": "@docker/actions-toolkit@npm:^0.61.0":
version: 0.56.0 version: 0.61.0
resolution: "@docker/actions-toolkit@npm:0.56.0" resolution: "@docker/actions-toolkit@npm:0.61.0"
dependencies: dependencies:
"@actions/artifact": ^2.2.2 "@actions/artifact": ^2.3.2
"@actions/cache": ^4.0.2 "@actions/cache": ^4.0.3
"@actions/core": ^1.11.1 "@actions/core": ^1.11.1
"@actions/exec": ^1.1.1 "@actions/exec": ^1.1.1
"@actions/github": ^6.0.0 "@actions/github": ^6.0.0
@ -1113,7 +1113,7 @@ __metadata:
semver: ^7.7.1 semver: ^7.7.1
tar-stream: ^3.1.7 tar-stream: ^3.1.7
tmp: ^0.2.3 tmp: ^0.2.3
checksum: 0f1b569f8bb206399f8c26e566c78e30e4a311bbd64486016e7fa1d35fbbb4c94d4f55afa6b711afa4b41c5835b40b038f48c3d1bfdfdc6f7c6680973e922d9e checksum: 60cc6c8f5bde8221a3d6a40c15258d44a468950353098f1814d8af3a14131df9c41df5b87298cd82f5c77aa4e36e262c15a5bb0cc03ea2857bea18c9e0952d80
languageName: node languageName: node
linkType: hard linkType: hard
@ -3161,7 +3161,7 @@ __metadata:
resolution: "docker-setup-buildx@workspace:." resolution: "docker-setup-buildx@workspace:."
dependencies: dependencies:
"@actions/core": ^1.11.1 "@actions/core": ^1.11.1
"@docker/actions-toolkit": ^0.56.0 "@docker/actions-toolkit": ^0.61.0
"@types/js-yaml": ^4.0.9 "@types/js-yaml": ^4.0.9
"@types/node": ^20.12.12 "@types/node": ^20.12.12
"@types/uuid": ^10.0.0 "@types/uuid": ^10.0.0