Merge pull request #1033 from crazy-max/git-context-fallback
buildx(build): simplify git context format fallback
This commit is contained in:
@@ -79,13 +79,17 @@ export class Build {
|
|||||||
const baseURL = `${GitHub.serverURL}/${github.context.repo.owner}/${github.context.repo.repo}.git`;
|
const baseURL = `${GitHub.serverURL}/${github.context.repo.owner}/${github.context.repo.repo}.git`;
|
||||||
let format = opts?.format;
|
let format = opts?.format;
|
||||||
if (!format) {
|
if (!format) {
|
||||||
const sendGitQueryAsInput = Util.parseBoolOrDefault(process.env.BUILDX_SEND_GIT_QUERY_AS_INPUT);
|
format = 'fragment';
|
||||||
if (attrs.length > 0) {
|
if (attrs.length > 0) {
|
||||||
format = 'query';
|
format = 'query';
|
||||||
} else if (sendGitQueryAsInput && (await this.buildx.versionSatisfies('>=0.29.0'))) {
|
} else if (Util.parseBoolOrDefault(process.env.BUILDX_SEND_GIT_QUERY_AS_INPUT)) {
|
||||||
format = 'query';
|
try {
|
||||||
} else {
|
if (await this.buildx.versionSatisfies('>=0.29.0')) {
|
||||||
format = 'fragment';
|
format = 'query';
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// keep fragment fallback when Buildx version cannot be determined.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (format === 'query') {
|
if (format === 'query') {
|
||||||
|
|||||||
Reference in New Issue
Block a user