mirror of
https://github.com/docker/build-push-action.git
synced 2026-07-05 15:25:46 +00:00
Compare commits
9 Commits
4cb9e9c96f
...
1366234aeb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1366234aeb | ||
|
|
fd2fc5e1bd | ||
|
|
07f59006cd | ||
|
|
3351711634 | ||
|
|
28ee4c0a46 | ||
|
|
0c29210b88 | ||
|
|
a33158e734 | ||
|
|
cc7b76bcfd | ||
|
|
f3aee6067d |
@ -13,7 +13,7 @@
|
|||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": "latest",
|
"ecmaVersion": "2023",
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|||||||
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@ -1013,23 +1013,6 @@ jobs:
|
|||||||
build-contexts: |
|
build-contexts: |
|
||||||
alpine=docker-image://localhost:5000/my-base-image:latest
|
alpine=docker-image://localhost:5000/my-base-image:latest
|
||||||
|
|
||||||
docker-config-malformed:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
-
|
|
||||||
name: Set malformed docker config
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo 'foo_bar' >> ~/.docker/config.json
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
context: ./test
|
|
||||||
|
|
||||||
proxy-docker-config:
|
proxy-docker-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
|
|||||||
2
dist/index.js
generated
vendored
2
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
21
src/main.ts
21
src/main.ts
@ -1,5 +1,4 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
|
||||||
import * as stateHelper from './state-helper';
|
import * as stateHelper from './state-helper';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as actionsToolkit from '@docker/actions-toolkit';
|
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||||
@ -9,7 +8,6 @@ import {Exec} from '@docker/actions-toolkit/lib/exec';
|
|||||||
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||||
import {Inputs as BuildxInputs} from '@docker/actions-toolkit/lib/buildx/inputs';
|
import {Inputs as BuildxInputs} from '@docker/actions-toolkit/lib/buildx/inputs';
|
||||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||||
import {ConfigFile} from '@docker/actions-toolkit/lib/types/docker';
|
|
||||||
|
|
||||||
import * as context from './context';
|
import * as context from './context';
|
||||||
|
|
||||||
@ -36,16 +34,9 @@ actionsToolkit.run(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Proxy configuration`, async () => {
|
const dockerConfig = await Docker.configFile();
|
||||||
let dockerConfig: ConfigFile | undefined;
|
if (dockerConfig && dockerConfig.proxies) {
|
||||||
let dockerConfigMalformed = false;
|
await core.group(`Proxy configuration found`, async () => {
|
||||||
try {
|
|
||||||
dockerConfig = await Docker.configFile();
|
|
||||||
} catch (e) {
|
|
||||||
dockerConfigMalformed = true;
|
|
||||||
core.warning(`Unable to parse config file ${path.join(Docker.configDir, 'config.json')}: ${e}`);
|
|
||||||
}
|
|
||||||
if (dockerConfig && dockerConfig.proxies) {
|
|
||||||
for (const host in dockerConfig.proxies) {
|
for (const host in dockerConfig.proxies) {
|
||||||
let prefix = '';
|
let prefix = '';
|
||||||
if (Object.keys(dockerConfig.proxies).length > 1) {
|
if (Object.keys(dockerConfig.proxies).length > 1) {
|
||||||
@ -56,10 +47,8 @@ actionsToolkit.run(
|
|||||||
core.info(`${prefix}${key}: ${dockerConfig.proxies[host][key]}`);
|
core.info(`${prefix}${key}: ${dockerConfig.proxies[host][key]}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!dockerConfigMalformed) {
|
});
|
||||||
core.info('No proxy configuration found');
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!(await toolkit.buildx.isAvailable())) {
|
if (!(await toolkit.buildx.isAvailable())) {
|
||||||
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"target": "es6",
|
"target": "ES2022",
|
||||||
"module": "commonjs",
|
"module": "nodenext",
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user