mirror of
https://gh-proxy.com/https://github.com/docker/build-push-action
synced 2026-03-22 20:28:47 +08:00
Compare commits
1 Commits
releases/v
...
59df9ae781
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59df9ae781 |
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/dist/**
|
||||||
|
/coverage/**
|
||||||
|
/node_modules/**
|
||||||
24
.eslintrc.json
Normal file
24
.eslintrc.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"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": 2023,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"@typescript-eslint",
|
||||||
|
"jest",
|
||||||
|
"prettier"
|
||||||
|
]
|
||||||
|
}
|
||||||
49
.github/workflows/update-dist.yml
vendored
49
.github/workflows/update-dist.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
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
|
|
||||||
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
12
.yarnrc.yml
12
.yarnrc.yml
@@ -1,9 +1,3 @@
|
|||||||
# https://yarnpkg.com/configuration/yarnrc
|
|
||||||
|
|
||||||
compressionLevel: mixed
|
|
||||||
enableGlobalCache: false
|
|
||||||
enableHardenedMode: true
|
|
||||||
|
|
||||||
logFilters:
|
logFilters:
|
||||||
- code: YN0013
|
- code: YN0013
|
||||||
level: discard
|
level: discard
|
||||||
@@ -11,7 +5,9 @@ logFilters:
|
|||||||
level: discard
|
level: discard
|
||||||
- code: YN0076
|
- code: YN0076
|
||||||
level: discard
|
level: discard
|
||||||
- code: YN0086
|
|
||||||
level: discard
|
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||||
|
spec: "@yarnpkg/plugin-interactive-tools"
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ ccc"`],
|
|||||||
[
|
[
|
||||||
'build',
|
'build',
|
||||||
'--output', '.',
|
'--output', '.',
|
||||||
'--secret', `id=GIT_AUTH_TOKEN.github.com,src=${tmpName}`,
|
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
|
||||||
'https://github.com/docker/build-push-action.git#refs/heads/master'
|
'https://github.com/docker/build-push-action.git#refs/heads/master'
|
||||||
],
|
],
|
||||||
undefined
|
undefined
|
||||||
@@ -478,7 +478,7 @@ nproc=3`],
|
|||||||
[
|
[
|
||||||
'build',
|
'build',
|
||||||
'--iidfile', imageIDFilePath,
|
'--iidfile', imageIDFilePath,
|
||||||
'--secret', `id=GIT_AUTH_TOKEN.github.com,src=${tmpName}`,
|
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
|
||||||
'--metadata-file', metadataJson,
|
'--metadata-file', metadataJson,
|
||||||
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
|
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
|
||||||
],
|
],
|
||||||
@@ -857,52 +857,6 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
|
|||||||
['BUILDX_NO_DEFAULT_ATTESTATIONS', '1']
|
['BUILDX_NO_DEFAULT_ATTESTATIONS', '1']
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
[
|
|
||||||
35,
|
|
||||||
'0.13.1',
|
|
||||||
new Map<string, string>([
|
|
||||||
['github-token', 'abcdefghijklmno0123456789'],
|
|
||||||
['context', '{{defaultContext}}'],
|
|
||||||
['load', 'false'],
|
|
||||||
['no-cache', 'false'],
|
|
||||||
['push', 'false'],
|
|
||||||
['pull', 'false'],
|
|
||||||
]),
|
|
||||||
[
|
|
||||||
'build',
|
|
||||||
'--iidfile', imageIDFilePath,
|
|
||||||
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=http://10.0.0.5:22827/docker/build-push-action/actions/runs/123456789/attempts/1`,
|
|
||||||
'--secret', `id=GIT_AUTH_TOKEN.10.0.0.5:22827,src=${tmpName}`,
|
|
||||||
'--metadata-file', metadataJson,
|
|
||||||
'http://10.0.0.5:22827/docker/build-push-action.git#refs/heads/master'
|
|
||||||
],
|
|
||||||
new Map<string, string>([
|
|
||||||
['GITHUB_SERVER_URL', 'http://10.0.0.5:22827'],
|
|
||||||
])
|
|
||||||
],
|
|
||||||
[
|
|
||||||
36,
|
|
||||||
'0.13.1',
|
|
||||||
new Map<string, string>([
|
|
||||||
['github-token', 'abcdefghijklmno0123456789'],
|
|
||||||
['context', '{{defaultContext}}'],
|
|
||||||
['load', 'false'],
|
|
||||||
['no-cache', 'false'],
|
|
||||||
['push', 'false'],
|
|
||||||
['pull', 'false'],
|
|
||||||
]),
|
|
||||||
[
|
|
||||||
'build',
|
|
||||||
'--iidfile', imageIDFilePath,
|
|
||||||
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.cds.internal.unity3d.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
|
|
||||||
'--secret', `id=GIT_AUTH_TOKEN.github.cds.internal.unity3d.com,src=${tmpName}`,
|
|
||||||
'--metadata-file', metadataJson,
|
|
||||||
'https://github.cds.internal.unity3d.com/docker/build-push-action.git#refs/heads/master'
|
|
||||||
],
|
|
||||||
new Map<string, string>([
|
|
||||||
['GITHUB_SERVER_URL', 'https://github.cds.internal.unity3d.com'],
|
|
||||||
])
|
|
||||||
],
|
|
||||||
])(
|
])(
|
||||||
'[%d] given %p with %p as inputs, returns %p',
|
'[%d] given %p with %p as inputs, returns %p',
|
||||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>, envs: Map<string, string> | undefined) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>, envs: Map<string, string> | undefined) => {
|
||||||
|
|||||||
42
dist/index.js
generated
vendored
42
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
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
@@ -1,58 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
||||||
const {defineConfig, globalIgnores} = require('eslint/config');
|
|
||||||
const {fixupConfigRules, fixupPluginRules} = require('@eslint/compat');
|
|
||||||
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
|
|
||||||
const jestPlugin = require('eslint-plugin-jest');
|
|
||||||
const prettier = require('eslint-plugin-prettier');
|
|
||||||
const globals = require('globals');
|
|
||||||
const tsParser = require('@typescript-eslint/parser');
|
|
||||||
const js = require('@eslint/js');
|
|
||||||
const {FlatCompat} = require('@eslint/eslintrc');
|
|
||||||
|
|
||||||
// __dirname and __filename exist natively in CommonJS
|
|
||||||
const compat = new FlatCompat({
|
|
||||||
baseDirectory: __dirname,
|
|
||||||
recommendedConfig: js.configs.recommended,
|
|
||||||
allConfig: js.configs.all
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = defineConfig([
|
|
||||||
globalIgnores(['dist/**/*', 'coverage/**/*', 'node_modules/**/*']),
|
|
||||||
{
|
|
||||||
// prettier-ignore
|
|
||||||
extends: fixupConfigRules(
|
|
||||||
compat.extends(
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/eslint-recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'plugin:jest/recommended',
|
|
||||||
'plugin:prettier/recommended'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
|
|
||||||
plugins: {
|
|
||||||
'@typescript-eslint': fixupPluginRules(typescriptEslint),
|
|
||||||
jest: fixupPluginRules(jestPlugin),
|
|
||||||
prettier: fixupPluginRules(prettier)
|
|
||||||
},
|
|
||||||
|
|
||||||
languageOptions: {
|
|
||||||
globals: {
|
|
||||||
...globals.node,
|
|
||||||
...globals.jest
|
|
||||||
},
|
|
||||||
parser: tsParser,
|
|
||||||
ecmaVersion: 'latest',
|
|
||||||
sourceType: 'module'
|
|
||||||
},
|
|
||||||
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-require-imports': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
allowAsImport: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
import fs from 'fs';
|
||||||
const fs = require('fs');
|
import os from 'os';
|
||||||
const os = require('os');
|
import path from 'path';
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-build-push-action-'));
|
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-build-push-action-'));
|
||||||
|
|
||||||
@@ -10,7 +9,9 @@ process.env = Object.assign({}, process.env, {
|
|||||||
GITHUB_REPOSITORY: 'docker/build-push-action',
|
GITHUB_REPOSITORY: 'docker/build-push-action',
|
||||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||||
});
|
}) as {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
clearMocks: false,
|
clearMocks: false,
|
||||||
31
package.json
31
package.json
@@ -24,28 +24,25 @@
|
|||||||
],
|
],
|
||||||
"author": "Docker Inc.",
|
"author": "Docker Inc.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@docker/actions-toolkit": "0.62.1",
|
"@docker/actions-toolkit": "0.72.0",
|
||||||
"handlebars": "^4.7.7"
|
"handlebars": "^4.7.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/compat": "^2.0.0",
|
"@types/node": "^20.12.12",
|
||||||
"@eslint/eslintrc": "^3.3.3",
|
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
||||||
"@eslint/js": "^9.39.2",
|
"@typescript-eslint/parser": "^7.9.0",
|
||||||
"@types/node": "^20.19.27",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
"eslint": "^8.57.0",
|
||||||
"@typescript-eslint/parser": "^8.50.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"@vercel/ncc": "^0.38.4",
|
"eslint-plugin-jest": "^28.5.0",
|
||||||
"eslint": "^9.39.2",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"jest": "^29.7.0",
|
||||||
"eslint-plugin-jest": "^29.5.0",
|
"prettier": "^3.2.5",
|
||||||
"eslint-plugin-prettier": "^5.5.4",
|
"ts-jest": "^29.1.2",
|
||||||
"jest": "^30.2.0",
|
|
||||||
"prettier": "^3.7.4",
|
|
||||||
"ts-jest": "^29.4.6",
|
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.4.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
|
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
|
||||||
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN.${new URL(GitHub.serverURL).host.trimEnd()}=${inputs['github-token']}`));
|
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN=${inputs['github-token']}`));
|
||||||
}
|
}
|
||||||
if (inputs['shm-size']) {
|
if (inputs['shm-size']) {
|
||||||
args.push('--shm-size', inputs['shm-size']);
|
args.push('--shm-size', inputs['shm-size']);
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ actionsToolkit.run(
|
|||||||
await core.group(`Removing temp folder ${stateHelper.tmpDir}`, async () => {
|
await core.group(`Removing temp folder ${stateHelper.tmpDir}`, async () => {
|
||||||
try {
|
try {
|
||||||
fs.rmSync(stateHelper.tmpDir, {recursive: true});
|
fs.rmSync(stateHelper.tmpDir, {recursive: true});
|
||||||
} catch {
|
} catch (e) {
|
||||||
core.warning(`Failed to remove temp folder ${stateHelper.tmpDir}`);
|
core.warning(`Failed to remove temp folder ${stateHelper.tmpDir}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export function setSummaryInputs(inputs: Inputs) {
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const [skey, _] = Build.parseSecretKvp(secret, true);
|
const [skey, _] = Build.parseSecretKvp(secret, true);
|
||||||
secretKeys.push(skey);
|
secretKeys.push(skey);
|
||||||
} catch {
|
} catch (err) {
|
||||||
// ignore invalid secret
|
// ignore invalid secret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user