Skip to content

Commit

Permalink
Fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Jun 28, 2023
1 parent 9e549af commit e24f947
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,22 @@ const {getPreviousVersion, SEMANTIC_VERSION_LEVELS} = __nccwpck_require__(8007);
* @param {String} tag
*/
function fetchTag(tag) {
const previousMinorVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
const previousPatchVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
try {
let command = `git fetch origin tag ${tag} --no-tags`;

// Exclude commits reachable from the previous minor version (i.e: previous checklist),
// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousMinorVersion !== tag) {
command += ` --shallow-exclude=${previousMinorVersion}`;
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}

console.log(`Running command: ${command}`);
execSync(command);
} catch (e) {
// This can happen if the tag was only created locally but does not exist in the remote. In this case, we'll fetch history of the staging branch instead
const command = `git fetch origin staging --no-tags --shallow-exclude=${previousMinorVersion}`;
const command = `git fetch origin staging --no-tags --shallow-exclude=${previousPatchVersion}`;
console.log(`Running command: ${command}`);
execSync(command);
}
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,22 @@ const {getPreviousVersion, SEMANTIC_VERSION_LEVELS} = __nccwpck_require__(8007);
* @param {String} tag
*/
function fetchTag(tag) {
const previousMinorVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
const previousPatchVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
try {
let command = `git fetch origin tag ${tag} --no-tags`;

// Exclude commits reachable from the previous minor version (i.e: previous checklist),
// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousMinorVersion !== tag) {
command += ` --shallow-exclude=${previousMinorVersion}`;
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}

console.log(`Running command: ${command}`);
execSync(command);
} catch (e) {
// This can happen if the tag was only created locally but does not exist in the remote. In this case, we'll fetch history of the staging branch instead
const command = `git fetch origin staging --no-tags --shallow-exclude=${previousMinorVersion}`;
const command = `git fetch origin staging --no-tags --shallow-exclude=${previousPatchVersion}`;
console.log(`Running command: ${command}`);
execSync(command);
}
Expand Down
10 changes: 5 additions & 5 deletions .github/libs/GitUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ const {getPreviousVersion, SEMANTIC_VERSION_LEVELS} = require('../libs/versionUp
* @param {String} tag
*/
function fetchTag(tag) {
const previousMinorVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
const previousPatchVersion = getPreviousVersion(tag, SEMANTIC_VERSION_LEVELS.PATCH);
try {
let command = `git fetch origin tag ${tag} --no-tags`;

// Exclude commits reachable from the previous minor version (i.e: previous checklist),
// Exclude commits reachable from the previous patch version (i.e: previous checklist),
// so that we don't have to fetch the full history
// Note that this condition would only ever _not_ be true in the 1.0.0-0 edge case
if (previousMinorVersion !== tag) {
command += ` --shallow-exclude=${previousMinorVersion}`;
if (previousPatchVersion !== tag) {
command += ` --shallow-exclude=${previousPatchVersion}`;
}

console.log(`Running command: ${command}`);
execSync(command);
} catch (e) {
// This can happen if the tag was only created locally but does not exist in the remote. In this case, we'll fetch history of the staging branch instead
const command = `git fetch origin staging --no-tags --shallow-exclude=${previousMinorVersion}`;
const command = `git fetch origin staging --no-tags --shallow-exclude=${previousPatchVersion}`;
console.log(`Running command: ${command}`);
execSync(command);
}
Expand Down

0 comments on commit e24f947

Please sign in to comment.