Skip to content

Commit cdf706d

Browse files
authored
Merge pull request #1 from lucdelsalle/chore/improve-azure-pipeline-module
Add a way to skip the call to _getPR in the _getSHA function
2 parents af1b7a9 + 1e8b6f5 commit cdf706d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/bundler-plugin-core/src/utils/providers/AzurePipelines.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ function _getSHA(
107107
}
108108

109109
let commit = envs?.BUILD_SOURCEVERSION ?? null;
110+
const skip_merge_commit_from_pr = Boolean(envs?.SYSTEM_SKIP_MERGE_COMMIT_FROM_PR);
110111

111-
if (_getPR(inputs, output)) {
112+
if (!skip_merge_commit_from_pr && _getPR(inputs, output)) {
112113
const mergeCommitRegex = /^[a-z0-9]{40} [a-z0-9]{40}$/;
113114
const mergeCommitMessage = childProcess
114115
.execFileSync("git", ["show", "--no-patch", "--format=%P"])
@@ -176,5 +177,6 @@ export function getEnvVarNames() {
176177
"SYSTEM_PULLREQUEST_PULLREQUESTNUMBER",
177178
"SYSTEM_TEAMFOUNDATIONSERVERURI",
178179
"SYSTEM_TEAMPROJECT",
180+
"SYSTEM_SKIP_MERGE_COMMIT_FROM_PR",
179181
];
180182
}

0 commit comments

Comments
 (0)