Skip to content

Commit

Permalink
Workflow Bug fixes (#11699)
Browse files Browse the repository at this point in the history
Updated ts workflow files to fix bugs
  • Loading branch information
rahul0216 authored Jan 23, 2025
1 parent bb104b3 commit 9954448
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .script/idChangeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function IsIdHasChanged(filePath: string): Promise<ExitCode> {
return ExitCode.ERROR;
}

const options = [pr.targetBranch, pr.sourceBranch, filePath];
const options = [pr.base.ref, pr.head.ref, filePath];
const diffSummary = await git.diff(options);
const idPosition = diffSummary.search(templateIdRegex);
const idHasChanged = idPosition > 0;
Expand Down
2 changes: 1 addition & 1 deletion .script/utils/gitHubWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function GetDiffFiles(fileKinds: string[], fileTypeSuffixes?: strin
console.log(`${changedFiles.length} files changed in current PR`);

const filterChangedFiles = changedFiles
.filter(change => fileKinds.includes(change.status))
.filter(change => fileKinds.map(kind => kind.toLowerCase()).includes(change.status.toLowerCase()))
.map(change => change.filename)
.filter(filePath => typeof fileTypeSuffixes === "undefined" || filePath.endsWithAny(fileTypeSuffixes))
.filter(filePath => typeof filePathFolderPreffixes === "undefined" || filePath.startsWithAny(filePathFolderPreffixes))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function isVersionIncrementedOnModification(items: Array<WorkbookMe
if(pr){ // pr may return undefined
const changedFiles = await GetDiffFiles(fileKinds, fileTypeSuffixes, filePathFolderPrefixes);
if(changedFiles && changedFiles.length > 0){
const options = [pr.targetBranch, pr.sourceBranch, gitDiffFileFullContentOption, `${workbooksDirectoryPath}/WorkbooksMetadata.json`];
const options = [pr.base.ref, pr.head.ref, gitDiffFileFullContentOption, `${workbooksDirectoryPath}/WorkbooksMetadata.json`];
const diffSummary = await git.diff(options);
const diffLinesArray: string[] = diffSummary.split('\n').map((l: string) => l.trim());
const versionChanges = extractVersionChangesByWorkbook(diffLinesArray);
Expand Down

0 comments on commit 9954448

Please sign in to comment.