mirror of
https://github.com/docker/metadata-action.git
synced 2025-12-06 08:56:46 +03:00
Compare commits
27 Commits
032a4b3bda
...
43fa4ac0d3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43fa4ac0d3 | ||
|
|
b3120f2f18 | ||
|
|
1f469d21ee | ||
|
|
b0a2bcfe7b | ||
|
|
14973dfd4b | ||
|
|
dae123c2bf | ||
|
|
fdb90a51ae | ||
|
|
e5afe339d8 | ||
|
|
17e37c2a42 | ||
|
|
aa0be5b84c | ||
|
|
136a4a23fe | ||
|
|
5f9eb12581 | ||
|
|
be25a4ce07 | ||
|
|
eced061233 | ||
|
|
e7f20f98b1 | ||
|
|
95bdd37b1f | ||
|
|
3fb4efdf45 | ||
|
|
f31cd74edd | ||
|
|
840a42f4cf | ||
|
|
ada8aa8ca0 | ||
|
|
3fa6bb33cb | ||
|
|
8aa9733355 | ||
|
|
d87caff40c | ||
|
|
83e4951424 | ||
|
|
9efc8723fe | ||
|
|
ec2c9a30cf | ||
|
|
e427fa1e40 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -431,7 +431,7 @@ jobs:
|
|||||||
sep-tags: ${{ matrix.sep }}
|
sep-tags: ${{ matrix.sep }}
|
||||||
-
|
-
|
||||||
name: Tags
|
name: Tags
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v8
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
console.log(`${{ steps.meta.outputs.tags }}`);
|
console.log(`${{ steps.meta.outputs.tags }}`);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@ -131,7 +131,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@ -314,6 +314,7 @@ The following outputs are available:
|
|||||||
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `version` | String | Docker image version |
|
| `version` | String | Docker image version |
|
||||||
| `tags` | String | Docker tags |
|
| `tags` | String | Docker tags |
|
||||||
|
| `tag-names` | String | Docker tag names without image base name |
|
||||||
| `labels` | String | Docker labels |
|
| `labels` | String | Docker labels |
|
||||||
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||||
| `json` | String | JSON output of tags and labels |
|
| `json` | String | JSON output of tags and labels |
|
||||||
|
|||||||
@ -3936,6 +3936,12 @@ describe('json', () => {
|
|||||||
"user/app:custom",
|
"user/app:custom",
|
||||||
"user/app:tags"
|
"user/app:tags"
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"dev",
|
||||||
|
"my",
|
||||||
|
"custom",
|
||||||
|
"tags"
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"foo": "",
|
"foo": "",
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
@ -3974,6 +3980,10 @@ describe('json', () => {
|
|||||||
"user/app:dev",
|
"user/app:dev",
|
||||||
"user/app:my",
|
"user/app:my",
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"dev",
|
||||||
|
"my",
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4017,6 +4027,13 @@ describe('json', () => {
|
|||||||
"user/app:tags",
|
"user/app:tags",
|
||||||
"user/app:latest"
|
"user/app:latest"
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"release1",
|
||||||
|
"my",
|
||||||
|
"custom",
|
||||||
|
"tags",
|
||||||
|
"latest"
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4061,6 +4078,12 @@ describe('json', () => {
|
|||||||
"user/app:custom",
|
"user/app:custom",
|
||||||
"user/app:tags"
|
"user/app:tags"
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"20200110",
|
||||||
|
"my",
|
||||||
|
"custom",
|
||||||
|
"tags"
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4114,6 +4137,15 @@ describe('json', () => {
|
|||||||
"ghcr.io/user/app:tags",
|
"ghcr.io/user/app:tags",
|
||||||
"ghcr.io/user/app:latest"
|
"ghcr.io/user/app:latest"
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"1.1.1",
|
||||||
|
"1.1",
|
||||||
|
"1",
|
||||||
|
"my",
|
||||||
|
"custom",
|
||||||
|
"tags",
|
||||||
|
"latest",
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4156,6 +4188,11 @@ describe('json', () => {
|
|||||||
"ghcr.io/user/app:custom",
|
"ghcr.io/user/app:custom",
|
||||||
"ghcr.io/user/app:tags"
|
"ghcr.io/user/app:tags"
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"my",
|
||||||
|
"custom",
|
||||||
|
"tags",
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4196,6 +4233,10 @@ describe('json', () => {
|
|||||||
"org/app:v1.1.1",
|
"org/app:v1.1.1",
|
||||||
"org/app:latest"
|
"org/app:latest"
|
||||||
],
|
],
|
||||||
|
"tag-names": [
|
||||||
|
"v1.1.1",
|
||||||
|
"latest"
|
||||||
|
],
|
||||||
"labels": {
|
"labels": {
|
||||||
"maintainer": "CrazyMax",
|
"maintainer": "CrazyMax",
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
|
|||||||
@ -48,6 +48,8 @@ outputs:
|
|||||||
description: 'Generated Docker image version'
|
description: 'Generated Docker image version'
|
||||||
tags:
|
tags:
|
||||||
description: 'Generated Docker tags'
|
description: 'Generated Docker tags'
|
||||||
|
tag-names:
|
||||||
|
description: 'Generated Docker tag names without image base name'
|
||||||
labels:
|
labels:
|
||||||
description: 'Generated Docker labels'
|
description: 'Generated Docker labels'
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
300
dist/606.index.js
generated
vendored
Normal file
300
dist/606.index.js
generated
vendored
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
"use strict";
|
||||||
|
exports.id = 606;
|
||||||
|
exports.ids = [606];
|
||||||
|
exports.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 runningMappersCount = 0;
|
||||||
|
let isDone = false;
|
||||||
|
let index = 0;
|
||||||
|
|
||||||
|
function trySpawn() {
|
||||||
|
if (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const promise = (async () => {
|
||||||
|
const {done, value} = await iterator.next();
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
return {done: true};
|
||||||
|
}
|
||||||
|
|
||||||
|
runningMappersCount++;
|
||||||
|
|
||||||
|
// Spawn if still below concurrency and backpressure limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const returnValue = await mapper(await value, index++);
|
||||||
|
|
||||||
|
runningMappersCount--;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
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
1
dist/606.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
302
dist/689.index.js
generated
vendored
Normal file
302
dist/689.index.js
generated
vendored
Normal file
@ -0,0 +1,302 @@
|
|||||||
|
"use strict";
|
||||||
|
exports.id = 689;
|
||||||
|
exports.ids = [689];
|
||||||
|
exports.modules = {
|
||||||
|
|
||||||
|
/***/ 11689:
|
||||||
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ pMap),
|
||||||
|
/* harmony export */ "pMapIterable": () => (/* binding */ pMapIterable),
|
||||||
|
/* harmony export */ "pMapSkip": () => (/* binding */ pMapSkip)
|
||||||
|
/* harmony export */ });
|
||||||
|
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 runningMappersCount = 0;
|
||||||
|
let isDone = false;
|
||||||
|
let index = 0;
|
||||||
|
|
||||||
|
function trySpawn() {
|
||||||
|
if (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const promise = (async () => {
|
||||||
|
const {done, value} = await iterator.next();
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
return {done: true};
|
||||||
|
}
|
||||||
|
|
||||||
|
runningMappersCount++;
|
||||||
|
|
||||||
|
// Spawn if still below concurrency and backpressure limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const returnValue = await mapper(await value, index++);
|
||||||
|
|
||||||
|
runningMappersCount--;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
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=689.index.js.map
|
||||||
1
dist/689.index.js.map
generated
vendored
Normal file
1
dist/689.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
96
dist/index.js
generated
vendored
96
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
4045
dist/licenses.txt
generated
vendored
4045
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
33
package.json
33
package.json
@ -29,30 +29,29 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/github": "^6.0.1",
|
"@actions/github": "^6.0.1",
|
||||||
"@docker/actions-toolkit": "^0.62.1",
|
"@docker/actions-toolkit": "^0.66.0",
|
||||||
"@renovate/pep440": "^1.0.0",
|
"@renovate/pep440": "^1.0.0",
|
||||||
"csv-parse": "^5.6.0",
|
"csv-parse": "^6.1.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"moment-timezone": "^0.6.0",
|
"moment-timezone": "^0.6.0",
|
||||||
"semver": "^7.7.2"
|
"semver": "^7.7.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/csv-parse": "^1.2.2",
|
"@types/node": "^20.19.9",
|
||||||
"@types/node": "^20.12.12",
|
"@types/semver": "^7.7.1",
|
||||||
"@types/semver": "^7.7.0",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
"@typescript-eslint/parser": "^7.9.0",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"@vercel/ncc": "^0.38.1",
|
"dotenv": "^16.6.1",
|
||||||
"dotenv": "^16.4.5",
|
"eslint": "^8.57.1",
|
||||||
"eslint": "^8.57.0",
|
"eslint-config-prettier": "^9.1.2",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-plugin-jest": "^28.14.0",
|
||||||
"eslint-plugin-jest": "^28.5.0",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.6.2",
|
||||||
"ts-jest": "^29.1.2",
|
"ts-jest": "^29.4.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.9.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ actionsToolkit.run(
|
|||||||
setOutput('version', version.main || '');
|
setOutput('version', version.main || '');
|
||||||
|
|
||||||
// Docker tags
|
// Docker tags
|
||||||
const tags: Array<string> = meta.getTags();
|
const tags = meta.getTags();
|
||||||
if (tags.length == 0) {
|
if (tags.length == 0) {
|
||||||
core.warning('No Docker tag has been generated. Check tags input.');
|
core.warning('No Docker tag has been generated. Check tags input.');
|
||||||
} else {
|
} else {
|
||||||
@ -58,6 +58,7 @@ actionsToolkit.run(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
setOutput('tags', tags.join(inputs.sepTags));
|
setOutput('tags', tags.join(inputs.sepTags));
|
||||||
|
setOutput('tag-names', meta.getTags(true).join(inputs.sepTags));
|
||||||
|
|
||||||
// Docker labels
|
// Docker labels
|
||||||
const labels: Array<string> = meta.getLabels();
|
const labels: Array<string> = meta.getLabels();
|
||||||
|
|||||||
35
src/meta.ts
35
src/meta.ts
@ -494,14 +494,30 @@ export class Meta {
|
|||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getTags(): Array<string> {
|
public getTags(namesOnly?: boolean): Array<string> {
|
||||||
if (!this.version.main) {
|
if (!this.version.main) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
if (namesOnly) {
|
||||||
|
return this.generateTags(this.version.main);
|
||||||
|
}
|
||||||
|
|
||||||
const generateTags = (imageName: string, version: string): Array<string> => {
|
|
||||||
const tags: Array<string> = [];
|
const tags: Array<string> = [];
|
||||||
const prefix = imageName !== '' ? `${imageName}:` : '';
|
const images = this.getImageNames();
|
||||||
|
if (images.length > 0) {
|
||||||
|
for (const imageName of images) {
|
||||||
|
tags.push(...this.generateTags(this.version.main, imageName));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tags.push(...this.generateTags(this.version.main));
|
||||||
|
}
|
||||||
|
|
||||||
|
return tags;
|
||||||
|
}
|
||||||
|
|
||||||
|
private generateTags(version: string, imageName?: string): Array<string> {
|
||||||
|
const tags: Array<string> = [];
|
||||||
|
const prefix = imageName ? `${imageName}:` : '';
|
||||||
tags.push(`${prefix}${version}`);
|
tags.push(`${prefix}${version}`);
|
||||||
for (const partial of this.version.partial) {
|
for (const partial of this.version.partial) {
|
||||||
tags.push(`${prefix}${partial}`);
|
tags.push(`${prefix}${partial}`);
|
||||||
@ -511,18 +527,6 @@ export class Meta {
|
|||||||
tags.push(`${prefix}${Meta.sanitizeTag(latestTag)}`);
|
tags.push(`${prefix}${Meta.sanitizeTag(latestTag)}`);
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
};
|
|
||||||
|
|
||||||
const tags: Array<string> = [];
|
|
||||||
const images = this.getImageNames();
|
|
||||||
if (images.length > 0) {
|
|
||||||
for (const imageName of images) {
|
|
||||||
tags.push(...generateTags(imageName, this.version.main));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tags.push(...generateTags('', this.version.main));
|
|
||||||
}
|
|
||||||
return tags;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getLabels(): Array<string> {
|
public getLabels(): Array<string> {
|
||||||
@ -568,6 +572,7 @@ export class Meta {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
|
'tag-names': this.getTags(true),
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
|
|||||||
@ -104,10 +104,10 @@ export function Parse(s: string): Tag {
|
|||||||
const value = parts[1];
|
const value = parts[1];
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'type': {
|
case 'type': {
|
||||||
if (!Object.values(Type).includes(value)) {
|
if (!Object.values(Type).includes(value as Type)) {
|
||||||
throw new Error(`Unknown tag type attribute: ${value}`);
|
throw new Error(`Unknown tag type attribute: ${value}`);
|
||||||
}
|
}
|
||||||
tag.type = value;
|
tag.type = value as Type;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user