Compare commits

..

45 commits
v1.2.0 ... main

Author SHA1 Message Date
CrazyMax
2fe291b767
Merge pull request #46 from docker/dependabot/npm_and_yarn/minimatch-3.1.4
Some checks are pending
ci / main () (push) Waiting to run
ci / main (cloud:latest) (push) Waiting to run
ci / main (v2.32.4) (push) Waiting to run
ci / main (cloud:v2.29.1-desktop.2) (push) Waiting to run
ci / multi (push) Waiting to run
ci / main (latest) (push) Waiting to run
validate / validate (push) Blocked by required conditions
ci / standalone (push) Waiting to run
ci / cache-binary (false) (push) Waiting to run
ci / cache-binary (true) (push) Waiting to run
test / test (push) Waiting to run
validate / prepare (push) Waiting to run
chore(deps): bump minimatch from 3.1.2 to 3.1.4
2026-02-27 15:02:25 +01:00
github-actions[bot]
8c2139e3cd chore: update generated content 2026-02-27 13:48:33 +00:00
dependabot[bot]
e0b48a103c
chore(deps): bump minimatch from 3.1.2 to 3.1.4
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.4.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.4)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 13:47:27 +00:00
CrazyMax
76aad036e9
Merge pull request #37 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.75.0
chore(deps): bump @docker/actions-toolkit from 0.62.1 to 0.77.0
2026-02-27 14:44:18 +01:00
github-actions[bot]
ada6bc9aca chore: update generated content 2026-02-27 13:38:18 +00:00
dependabot[bot]
8136bb0abf
chore(deps): bump @docker/actions-toolkit from 0.62.1 to 0.75.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.62.1 to 0.75.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.62.1...v0.75.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 13:37:16 +00:00
CrazyMax
9cdb971c19
Merge pull request #45 from docker/dependabot/npm_and_yarn/actions/core-3.0.0
chore(deps): bump @actions/core from 1.11.1 to 3.0.0
2026-02-27 14:35:34 +01:00
github-actions[bot]
5568a9cbea chore: update generated content 2026-02-27 13:26:18 +00:00
dependabot[bot]
5dae812372
chore(deps): bump @actions/core from 1.11.1 to 3.0.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.11.1 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 13:25:10 +00:00
CrazyMax
8482edc805
Merge pull request #47 from crazy-max/esm
switch to ESM and update config/test wiring
2026-02-27 14:23:05 +01:00
CrazyMax
0740da8ac0
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-27 14:06:08 +01:00
CrazyMax
c497bf8add
update dev dependencies
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-27 14:06:07 +01:00
CrazyMax
279a65f3bf
switch to ESM and update config/test wiring
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-27 14:01:57 +01:00
CrazyMax
e2b402d143
switch from jest to vitest
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-27 13:48:50 +01:00
CrazyMax
e79596b1b4
Merge pull request #44 from docker/dependabot/npm_and_yarn/undici-5.29.0
Some checks failed
ci / main () (push) Has been cancelled
ci / main (cloud:latest) (push) Has been cancelled
ci / main (cloud:v2.29.1-desktop.2) (push) Has been cancelled
ci / main (latest) (push) Has been cancelled
ci / main (v2.32.4) (push) Has been cancelled
ci / multi (push) Has been cancelled
ci / standalone (push) Has been cancelled
ci / cache-binary (false) (push) Has been cancelled
ci / cache-binary (true) (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 undici from 5.28.4 to 5.29.0
2026-01-29 17:11:08 +01:00
github-actions[bot]
8084624251 chore: update generated content 2026-01-29 16:05:18 +00:00
dependabot[bot]
12a53ec263
chore(deps): bump undici from 5.28.4 to 5.29.0
Bumps [undici](https://github.com/nodejs/undici) from 5.28.4 to 5.29.0.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.4...v5.29.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 5.29.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-29 16:04:13 +00:00
CrazyMax
279c22640e
Merge pull request #39 from docker/dependabot/npm_and_yarn/lodash-4.17.23
chore(deps): bump lodash from 4.17.21 to 4.17.23
2026-01-29 17:01:47 +01:00
CrazyMax
b1f7f2ca33
Merge pull request #38 from docker/dependabot/npm_and_yarn/js-yaml-3.14.2
chore(deps): bump js-yaml from 3.14.1 to 3.14.2
2026-01-29 17:01:29 +01:00
github-actions[bot]
90f1ae58e3 chore: update generated content 2026-01-29 15:47:00 +00:00
dependabot[bot]
ce0a6cec9d
chore(deps): bump lodash from 4.17.21 to 4.17.23
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.17.23
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-29 15:45:52 +00:00
dependabot[bot]
b1a889425d
chore(deps): bump js-yaml from 3.14.1 to 3.14.2
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.14.1 to 3.14.2.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.14.1...3.14.2)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 3.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-29 15:45:52 +00:00
CrazyMax
405c82c48a
Merge pull request #43 from crazy-max/yarn-update
update yarn to 4.9.2
2026-01-29 16:44:00 +01:00
CrazyMax
af8e2b6e8f
update yarn to 4.9.2
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 16:42:03 +01:00
CrazyMax
f3db6589a5
Merge pull request #42 from crazy-max/dev-deps
update dev dependencies
2026-01-29 16:40:00 +01:00
CrazyMax
0ddb5e8fcf
ci: rename job in update-dist workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 16:36:38 +01:00
CrazyMax
feb56d3c68
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 16:36:17 +01:00
CrazyMax
24f3159974
update jest config since 30.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 16:35:17 +01:00
CrazyMax
c827c799f9
migrate eslint config to new format required since 9.0.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 16:34:21 +01:00
CrazyMax
3420918368
update dev dependencies
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 16:33:17 +01:00
CrazyMax
5ebb8a1234
Merge pull request #41 from crazy-max/fix-update-dist
Some checks are pending
ci / main () (push) Waiting to run
ci / main (cloud:latest) (push) Waiting to run
ci / main (cloud:v2.29.1-desktop.2) (push) Waiting to run
ci / main (latest) (push) Waiting to run
ci / main (v2.32.4) (push) Waiting to run
ci / multi (push) Waiting to run
test / test (push) Waiting to run
validate / prepare (push) Waiting to run
validate / validate (push) Blocked by required conditions
ci / standalone (push) Waiting to run
ci / cache-binary (false) (push) Waiting to run
ci / cache-binary (true) (push) Waiting to run
ci: fix update-dist workflow
2026-01-29 15:37:05 +01:00
CrazyMax
018a8a74ba
ci: fix update-dist workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 15:24:38 +01:00
CrazyMax
7502d43660
Merge pull request #28 from docker/dependabot/github_actions/actions/checkout-6
chore(deps): bump actions/checkout from 5 to 6
2026-01-29 15:15:38 +01:00
CrazyMax
1fc6ffe25f
Merge pull request #40 from crazy-max/update-dist-workflow
ci: update-dist workflow
2026-01-29 15:14:59 +01:00
CrazyMax
9664d39295
ci: update-dist workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-29 15:01:11 +01:00
dependabot[bot]
30160f4da4
chore(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 01:11:35 +00:00
CrazyMax
23d018c8d3
Merge pull request #22 from docker/dependabot/github_actions/actions/checkout-5
chore(deps): bump actions/checkout from 4 to 5
2025-10-03 15:35:52 +02:00
dependabot[bot]
35f07640c9
chore(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 10:07:04 +00:00
CrazyMax
8d504d704c
Merge pull request #16 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.62.1
chore(deps): bump @docker/actions-toolkit from 0.56.0 to 0.62.1
2025-06-16 14:32:22 +02:00
CrazyMax
65532dcafa
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-06-16 14:30:32 +02:00
dependabot[bot]
4de0e6e148
chore(deps): bump @docker/actions-toolkit from 0.56.0 to 0.62.1
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.56.0 to 0.62.1.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.56.0...v0.62.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-28 01:16:26 +00:00
CrazyMax
23b64c3ea9
Merge pull request #13 from crazy-max/pr-assign-author
pr-assign-author workflow
2025-04-23 16:08:47 +02:00
CrazyMax
0a9030a247
pr-assign-author workflow 2025-04-23 14:19:47 +02:00
CrazyMax
45e44e28e6
Merge pull request #12 from crazy-max/fix-codecov
ci: fix missing source for codecov
2025-04-22 14:37:23 +02:00
CrazyMax
6ffe8afb0f
ci: fix missing source for codecov 2025-04-22 14:34:12 +02:00
29 changed files with 3196 additions and 9316 deletions

View file

@ -1,3 +0,0 @@
/dist/**
/coverage/**
/node_modules/**

View file

@ -1,24 +0,0 @@
{
"env": {
"node": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"jest",
"prettier"
]
}

View file

@ -31,7 +31,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
-
name: Set up Docker Compose
uses: ./
@ -43,7 +43,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
-
name: Set up Docker Compose 1
uses: ./
@ -56,7 +56,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
-
name: Uninstall docker cli
run: |
@ -80,7 +80,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
-
name: Set up Docker Compose
uses: ./

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

View file

@ -15,7 +15,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
-
name: Publish
uses: actions/publish-immutable-action@v0.0.4

View file

@ -19,6 +19,9 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v6
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@ -29,6 +32,7 @@ jobs:
name: Test
uses: docker/bake-action@v6
with:
source: .
targets: test
-
name: Upload coverage

49
.github/workflows/update-dist.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: update-dist
on:
pull_request:
types:
- opened
- synchronize
jobs:
update-dist:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
-
name: GitHub auth token from GitHub App
id: docker-read-app
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
owner: docker
-
name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
token: ${{ steps.docker-read-app.outputs.token || github.token }}
-
name: Build
uses: docker/bake-action@v6
with:
source: .
targets: build
-
name: Commit and push dist
run: |
if [ -n "$(git status --porcelain -- dist)" ]; then
(
set -x
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dist
git commit -m "chore: update generated content"
git push
)
else
echo "No changes in dist"
fi

View file

@ -23,7 +23,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
-
name: List targets
id: generate

View file

@ -6,6 +6,5 @@
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
"arrowParens": "avoid"
}

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,9 @@
# https://yarnpkg.com/configuration/yarnrc
compressionLevel: mixed
enableGlobalCache: false
enableHardenedMode: true
logFilters:
- code: YN0013
level: discard
@ -5,9 +11,7 @@ logFilters:
level: discard
- code: YN0076
level: discard
- code: YN0086
level: discard
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

View file

@ -1,23 +1,23 @@
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import {beforeEach, describe, expect, vi, test} from 'vitest';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import {Context} from '@docker/actions-toolkit/lib/context';
import {Context} from '@docker/actions-toolkit/lib/context.js';
import * as context from '../src/context';
import * as context from '../src/context.js';
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'setup-compose-jest');
const tmpName = path.join(tmpDir, '.tmpname-jest');
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'context-'));
const tmpName = path.join(tmpDir, '.tmpname-vi');
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
vi.spyOn(Context, 'tmpDir').mockImplementation((): string => {
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, {recursive: true});
}
return tmpDir;
});
jest.spyOn(Context, 'tmpName').mockImplementation((): string => {
vi.spyOn(Context, 'tmpName').mockImplementation((): string => {
return tmpName;
});

12
__tests__/setup.unit.ts Normal file
View file

@ -0,0 +1,12 @@
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-'));
process.env = Object.assign({}, process.env, {
TEMP: tmpDir,
GITHUB_REPOSITORY: 'docker/setup-compose-action',
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
});

View file

@ -74,7 +74,7 @@ FROM deps AS test
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run test --coverage --coverageDirectory=/tmp/coverage
yarn run test --coverage --coverage.reportsDirectory=/tmp/coverage
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage /

301
dist/606.index.js generated vendored Normal file
View file

@ -0,0 +1,301 @@
export const id = 606;
export const ids = [606];
export const modules = {
/***/ 606:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ pMap)
/* harmony export */ });
/* unused harmony exports pMapIterable, pMapSkip */
async function pMap(
iterable,
mapper,
{
concurrency = Number.POSITIVE_INFINITY,
stopOnError = true,
signal,
} = {},
) {
return new Promise((resolve_, reject_) => {
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
}
if (typeof mapper !== 'function') {
throw new TypeError('Mapper function is required');
}
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
}
const result = [];
const errors = [];
const skippedIndexesMap = new Map();
let isRejected = false;
let isResolved = false;
let isIterableDone = false;
let resolvingCount = 0;
let currentIndex = 0;
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
const signalListener = () => {
reject(signal.reason);
};
const cleanup = () => {
signal?.removeEventListener('abort', signalListener);
};
const resolve = value => {
resolve_(value);
cleanup();
};
const reject = reason => {
isRejected = true;
isResolved = true;
reject_(reason);
cleanup();
};
if (signal) {
if (signal.aborted) {
reject(signal.reason);
}
signal.addEventListener('abort', signalListener, {once: true});
}
const next = async () => {
if (isResolved) {
return;
}
const nextItem = await iterator.next();
const index = currentIndex;
currentIndex++;
// Note: `iterator.next()` can be called many times in parallel.
// This can cause multiple calls to this `next()` function to
// receive a `nextItem` with `done === true`.
// The shutdown logic that rejects/resolves must be protected
// so it runs only one time as the `skippedIndex` logic is
// non-idempotent.
if (nextItem.done) {
isIterableDone = true;
if (resolvingCount === 0 && !isResolved) {
if (!stopOnError && errors.length > 0) {
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
return;
}
isResolved = true;
if (skippedIndexesMap.size === 0) {
resolve(result);
return;
}
const pureResult = [];
// Support multiple `pMapSkip`'s.
for (const [index, value] of result.entries()) {
if (skippedIndexesMap.get(index) === pMapSkip) {
continue;
}
pureResult.push(value);
}
resolve(pureResult);
}
return;
}
resolvingCount++;
// Intentionally detached
(async () => {
try {
const element = await nextItem.value;
if (isResolved) {
return;
}
const value = await mapper(element, index);
// Use Map to stage the index of the element.
if (value === pMapSkip) {
skippedIndexesMap.set(index, value);
}
result[index] = value;
resolvingCount--;
await next();
} catch (error) {
if (stopOnError) {
reject(error);
} else {
errors.push(error);
resolvingCount--;
// In that case we can't really continue regardless of `stopOnError` state
// since an iterable is likely to continue throwing after it throws once.
// If we continue calling `next()` indefinitely we will likely end up
// in an infinite loop of failed iteration.
try {
await next();
} catch (error) {
reject(error);
}
}
}
})();
};
// Create the concurrent runners in a detached (non-awaited)
// promise. We need this so we can await the `next()` calls
// to stop creating runners before hitting the concurrency limit
// if the iterable has already been marked as done.
// NOTE: We *must* do this for async iterators otherwise we'll spin up
// infinite `next()` calls by default and never start the event loop.
(async () => {
for (let index = 0; index < concurrency; index++) {
try {
// eslint-disable-next-line no-await-in-loop
await next();
} catch (error) {
reject(error);
break;
}
if (isIterableDone || isRejected) {
break;
}
}
})();
});
}
function pMapIterable(
iterable,
mapper,
{
concurrency = Number.POSITIVE_INFINITY,
backpressure = concurrency,
} = {},
) {
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
}
if (typeof mapper !== 'function') {
throw new TypeError('Mapper function is required');
}
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
}
if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
}
return {
async * [Symbol.asyncIterator]() {
const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
const promises = [];
let pendingPromisesCount = 0;
let isDone = false;
let index = 0;
function trySpawn() {
if (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {
return;
}
pendingPromisesCount++;
const promise = (async () => {
const {done, value} = await iterator.next();
if (done) {
pendingPromisesCount--;
return {done: true};
}
// Spawn if still below concurrency and backpressure limit
trySpawn();
try {
const returnValue = await mapper(await value, index++);
pendingPromisesCount--;
if (returnValue === pMapSkip) {
const index = promises.indexOf(promise);
if (index > 0) {
promises.splice(index, 1);
}
}
// Spawn if still below backpressure limit and just dropped below concurrency limit
trySpawn();
return {done: false, value: returnValue};
} catch (error) {
pendingPromisesCount--;
isDone = true;
return {error};
}
})();
promises.push(promise);
}
trySpawn();
while (promises.length > 0) {
const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop
promises.shift();
if (error) {
throw error;
}
if (done) {
return;
}
// Spawn if just dropped below backpressure limit and below the concurrency limit
trySpawn();
if (value === pMapSkip) {
continue;
}
yield value;
}
},
};
}
const pMapSkip = Symbol('skip');
/***/ })
};
//# sourceMappingURL=606.index.js.map

1
dist/606.index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

122
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

3860
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load diff

3
dist/package.json generated vendored Normal file
View file

@ -0,0 +1,3 @@
{
"type": "module"
}

1
dist/sourcemap-register.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

52
eslint.config.mjs Normal file
View file

@ -0,0 +1,52 @@
import {defineConfig} from 'eslint/config';
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import vitest from '@vitest/eslint-plugin';
import globals from 'globals';
import eslintConfigPrettier from 'eslint-config-prettier/flat';
import eslintPluginPrettier from 'eslint-plugin-prettier';
export default defineConfig([
{
ignores: ['.yarn/**/*', 'coverage/**/*', 'dist/**/*']
},
js.configs.recommended,
...tseslint.configs['flat/recommended'],
eslintConfigPrettier,
{
languageOptions: {
globals: {
...globals.node
}
}
},
{
files: ['__tests__/**'],
...vitest.configs.recommended,
languageOptions: {
globals: {
...globals.node,
...vitest.environments.env.globals
}
},
rules: {
...vitest.configs.recommended.rules,
'vitest/no-conditional-expect': 'error',
'vitest/no-disabled-tests': 0
}
},
{
plugins: {
prettier: eslintPluginPrettier
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-require-imports': [
'error',
{
allowAsImport: true
}
]
}
}
]);

View file

@ -1,29 +0,0 @@
import fs from 'fs';
import os from 'os';
import path from 'path';
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-compose-action-')).split(path.sep).join(path.posix.sep);
process.env = Object.assign({}, process.env, {
TEMP: tmpDir,
GITHUB_REPOSITORY: 'docker/setup-compose-action',
RUNNER_TEMP: path.join(tmpDir, 'runner-temp').split(path.sep).join(path.posix.sep),
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache').split(path.sep).join(path.posix.sep)
}) as {
[key: string]: string;
};
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testMatch: ['**/*.test.ts'],
transform: {
'^.+\\.ts$': 'ts-jest'
},
moduleNameMapper: {
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
},
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__tests__/'],
verbose: true
};

View file

@ -1,16 +1,13 @@
{
"name": "docker-setup-compose",
"description": "Set up Docker Compose",
"type": "module",
"main": "src/main.ts",
"scripts": {
"build": "ncc build --source-map --minify --license licenses.txt",
"lint": "yarn run prettier && yarn run eslint",
"format": "yarn run prettier:fix && yarn run eslint:fix",
"eslint": "eslint --max-warnings=0 .",
"eslint:fix": "eslint --fix .",
"prettier": "prettier --check \"./**/*.ts\"",
"prettier:fix": "prettier --write \"./**/*.ts\"",
"test": "jest"
"lint": "eslint --max-warnings=0 .",
"format": "eslint --fix .",
"test": "vitest run"
},
"repository": {
"type": "git",
@ -23,24 +20,25 @@
],
"author": "Docker Inc.",
"license": "Apache-2.0",
"packageManager": "yarn@3.6.3",
"packageManager": "yarn@4.9.2",
"dependencies": {
"@actions/core": "^1.11.1",
"@docker/actions-toolkit": "^0.56.0"
"@actions/core": "^3.0.0",
"@docker/actions-toolkit": "^0.77.0"
},
"devDependencies": {
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
"@eslint/js": "^9.39.3",
"@types/node": "^20.19.35",
"@typescript-eslint/eslint-plugin": "^8.56.1",
"@typescript-eslint/parser": "^8.56.1",
"@vercel/ncc": "^0.38.4",
"@vitest/coverage-v8": "^4.0.18",
"@vitest/eslint-plugin": "^1.6.9",
"eslint": "^9.39.3",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"globals": "^17.3.0",
"prettier": "^3.8.1",
"typescript": "^5.9.3",
"vitest": "^4.0.18"
}
}

View file

@ -1,10 +1,10 @@
import * as core from '@actions/core';
import * as actionsToolkit from '@docker/actions-toolkit';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
import * as context from './context';
import * as context from './context.js';
actionsToolkit.run(
// main

View file

@ -1,8 +1,8 @@
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"esModuleInterop": true,
"target": "es6",
"module": "commonjs",
"strict": true,
"newLine": "lf",
"outDir": "./lib",
@ -12,10 +12,7 @@
"resolveJsonModule": true,
"useUnknownInCatchVariables": false,
},
"exclude": [
"./__tests__/**/*",
"./lib/**/*",
"node_modules",
"jest.config.ts"
"include": [
"src/**/*.ts"
]
}

32
vitest.config.ts Normal file
View file

@ -0,0 +1,32 @@
/**
* Copyright 2026 actions-toolkit authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {defineConfig} from 'vitest/config';
export default defineConfig({
test: {
clearMocks: true,
environment: 'node',
setupFiles: ['./__tests__/setup.unit.ts'],
include: ['**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['clover'],
include: ['src/**/*.ts'],
exclude: ['src/**/main.ts', '__tests__/**', 'dist/**']
}
}
});

7352
yarn.lock

File diff suppressed because it is too large Load diff