Compare commits

..

9 Commits

Author SHA1 Message Date
github-actions[bot]
4392a0a50e chore: update generated content 2026-03-24 17:54:06 +00:00
dependabot[bot]
80702da7a2 build(deps): bump fast-xml-parser from 5.3.4 to 5.3.6
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.3.4 to 5.3.6.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.3.4...v5.3.6)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.3.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-24 17:52:56 +00:00
CrazyMax
292fe2d7ee Merge pull request #944 from docker/dependabot/npm_and_yarn/flatted-3.4.2
build(deps): bump flatted from 3.3.3 to 3.4.2
2026-03-24 17:19:58 +01:00
CrazyMax
717e062c09 Merge pull request #945 from crazy-max/fix-scope-dir-dockerhub
fix scoped Docker Hub cleanup path when registry is omitted
2026-03-24 17:19:19 +01:00
CrazyMax
b9381571b7 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-24 10:29:02 +01:00
CrazyMax
7277d4d442 fix scoped Docker Hub cleanup path when registry is omitted
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-24 10:28:31 +01:00
dependabot[bot]
955b3c705f build(deps): bump flatted from 3.3.3 to 3.4.2
Bumps [flatted](https://github.com/WebReflection/flatted) from 3.3.3 to 3.4.2.
- [Commits](https://github.com/WebReflection/flatted/compare/v3.3.3...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-20 15:58:55 +00:00
CrazyMax
da5b89b92c Merge pull request #943 from crazy-max/codeql
ci: update codeql workflow
2026-03-20 16:57:15 +01:00
CrazyMax
b78dc2c156 ci: update codeql workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-20 11:48:51 +01:00
7 changed files with 58 additions and 63 deletions

View File

@@ -5,46 +5,41 @@ on:
branches:
- 'master'
- 'releases/v*'
paths:
- '.github/workflows/codeql.yml'
- 'dist/**'
- 'src/**'
pull_request:
paths:
- '.github/workflows/codeql.yml'
- 'dist/**'
- 'src/**'
permissions:
actions: read
contents: read
security-events: write
env:
NODE_VERSION: "24"
jobs:
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language:
- javascript-typescript
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: Enable corepack
run: |
corepack enable
yarn --version
-
name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
config: |
paths:
- src
-
name: Autobuild
uses: github/codeql-action/autobuild@v4
languages: javascript-typescript
build-mode: none
-
name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
category: "/language:javascript-typescript"

View File

@@ -1,6 +1,17 @@
import {expect, test} from 'vitest';
import {afterEach, expect, test} from 'vitest';
import * as path from 'path';
import {getInputs} from '../src/context.js';
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
import {getAuthList, getInputs} from '../src/context.js';
afterEach(() => {
for (const key of Object.keys(process.env)) {
if (key.startsWith('INPUT_')) {
delete process.env[key];
}
}
});
test('with password and username getInputs does not throw error', async () => {
process.env['INPUT_USERNAME'] = 'dbowie';
@@ -10,3 +21,15 @@ test('with password and username getInputs does not throw error', async () => {
getInputs();
}).not.toThrow();
});
test('getAuthList uses the default Docker Hub registry when computing scoped config dir', async () => {
process.env['INPUT_USERNAME'] = 'dbowie';
process.env['INPUT_PASSWORD'] = 'groundcontrol';
process.env['INPUT_SCOPE'] = 'myscope';
process.env['INPUT_LOGOUT'] = 'false';
const [auth] = getAuthList(getInputs());
expect(auth).toMatchObject({
registry: 'docker.io',
configDir: path.join(Buildx.configDir, 'config', 'registry-1.docker.io', 'myscope')
});
});

View File

@@ -1,15 +1,10 @@
import {expect, test, vi} from 'vitest';
import * as path from 'path';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
import {loginStandard, logout} from '../src/docker.js';
process.env['RUNNER_TEMP'] = path.join(__dirname, 'runner');
test('loginStandard calls exec', async () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const execSpy = vi.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
return {
exitCode: expect.any(Number),
@@ -38,8 +33,6 @@ test('loginStandard calls exec', async () => {
});
test('logout calls exec', async () => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const execSpy = vi.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
return {
exitCode: expect.any(Number),

12
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

@@ -42,24 +42,26 @@ export function getAuthList(inputs: Inputs): Array<Auth> {
}
let auths: Array<Auth> = [];
if (!inputs.registryAuth) {
const registry = inputs.registry || 'docker.io';
auths.push({
registry: inputs.registry || 'docker.io',
registry,
username: inputs.username,
password: inputs.password,
scope: inputs.scope,
ecr: inputs.ecr || 'auto',
configDir: scopeToConfigDir(inputs.registry, inputs.scope)
configDir: scopeToConfigDir(registry, inputs.scope)
});
} else {
auths = (yaml.load(inputs.registryAuth) as Array<Auth>).map(auth => {
core.setSecret(auth.password); // redacted in workflow logs
const registry = auth.registry || 'docker.io';
return {
registry: auth.registry || 'docker.io',
registry,
username: auth.username,
password: auth.password,
scope: auth.scope,
ecr: auth.ecr || 'auto',
configDir: scopeToConfigDir(auth.registry || 'docker.io', auth.scope)
configDir: scopeToConfigDir(registry, auth.scope)
};
});
}

View File

@@ -3575,7 +3575,7 @@ __metadata:
languageName: node
linkType: hard
"fast-xml-parser@npm:5.3.6":
"fast-xml-parser@npm:5.3.6, fast-xml-parser@npm:^5.0.7":
version: 5.3.6
resolution: "fast-xml-parser@npm:5.3.6"
dependencies:
@@ -3586,17 +3586,6 @@ __metadata:
languageName: node
linkType: hard
"fast-xml-parser@npm:^5.0.7":
version: 5.3.4
resolution: "fast-xml-parser@npm:5.3.4"
dependencies:
strnum: "npm:^2.1.0"
bin:
fxparser: src/cli/cli.js
checksum: 10/0d7e6872fed7c3065641400d43cdf24c03177f05c343bfb31df53b79f0900b085c103f647852d0b00693125aa3f0e9d8b8cfc4273b168d4da0308f857dafe830
languageName: node
linkType: hard
"fdir@npm:^6.5.0":
version: 6.5.0
resolution: "fdir@npm:6.5.0"
@@ -3639,9 +3628,9 @@ __metadata:
linkType: hard
"flatted@npm:^3.2.9":
version: 3.3.3
resolution: "flatted@npm:3.3.3"
checksum: 10/8c96c02fbeadcf4e8ffd0fa24983241e27698b0781295622591fc13585e2f226609d95e422bcf2ef044146ffacb6b68b1f20871454eddf75ab3caa6ee5f4a1fe
version: 3.4.2
resolution: "flatted@npm:3.4.2"
checksum: 10/a9e78fe5c2c1fcd98209a015ccee3a6caa953e01729778e83c1fe92e68601a63e1e69cd4e573010ca99eaf585a581b80ccf1018b99283e6cbc2117bcba1e030f
languageName: node
linkType: hard
@@ -5240,13 +5229,6 @@ __metadata:
languageName: node
linkType: hard
"strnum@npm:^2.1.0":
version: 2.1.1
resolution: "strnum@npm:2.1.1"
checksum: 10/d5fe6e4333cddc17569331048e403e876ffcf629989815f0359b0caf05dae9441b7eef3d7dd07427313ac8b3f05a8f60abc1f61efc15f97245dbc24028362bc9
languageName: node
linkType: hard
"strnum@npm:^2.1.2":
version: 2.2.0
resolution: "strnum@npm:2.2.0"