mirror of
https://github.com/docker/build-push-action.git
synced 2024-11-06 00:35:53 -05:00
Use latest buildx for git context test
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
9c473659de
commit
1c3fedb652
3 changed files with 17 additions and 12 deletions
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
|
@ -76,14 +76,15 @@ jobs:
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: ./setup-buildx/ # change to docker/setup-buildx-action@master
|
uses: ./setup-buildx/ # change to docker/setup-buildx-action@master
|
||||||
# with:
|
with:
|
||||||
|
version: latest
|
||||||
#driver-opt: network=host
|
#driver-opt: network=host
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: ./
|
uses: ./
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GIT_AUTH_TOKEN: ${{ github.token }}
|
||||||
GITHUB_REF: ${{ github.ref }}
|
GIT_REF: ${{ github.ref }}
|
||||||
with:
|
with:
|
||||||
context: ${{ github.repositoryUrl }}
|
context: ${{ github.repositoryUrl }}
|
||||||
file: ./test/Dockerfile
|
file: ./test/Dockerfile
|
||||||
|
|
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
|
@ -1912,10 +1912,12 @@ function getBuildContext() {
|
||||||
return '.';
|
return '.';
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const gitURL = git_url_parse_1.default(context);
|
const gitUrl = git_url_parse_1.default(context);
|
||||||
gitURL.token = gitURL.token || process.env['GIT_TOKEN'] || process.env['GITHUB_TOKEN'] || '';
|
const gitRef = process.env['GIT_REF'] || '';
|
||||||
gitURL.ref = gitURL.ref || process.env['GIT_REF'] || process.env['GITHUB_REF'] || '';
|
if (gitRef) {
|
||||||
return gitURL.toString();
|
return `${gitUrl.toString()}#${gitRef}`;
|
||||||
|
}
|
||||||
|
return gitUrl.toString();
|
||||||
}
|
}
|
||||||
catch (_a) {
|
catch (_a) {
|
||||||
return context;
|
return context;
|
||||||
|
|
|
@ -72,10 +72,12 @@ async function getBuildContext(): Promise<string> {
|
||||||
return '.';
|
return '.';
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const gitURL = gitUrlParse(context);
|
const gitUrl = gitUrlParse(context);
|
||||||
gitURL.token = gitURL.token || process.env['GIT_TOKEN'] || process.env['GITHUB_TOKEN'] || '';
|
const gitRef = process.env['GIT_REF'] || '';
|
||||||
gitURL.ref = gitURL.ref || process.env['GIT_REF'] || process.env['GITHUB_REF'] || '';
|
if (gitRef) {
|
||||||
return gitURL.toString();
|
return `${gitUrl.toString()}#${gitRef}`;
|
||||||
|
}
|
||||||
|
return gitUrl.toString();
|
||||||
} catch {
|
} catch {
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue