Skip to content

Commit b5e9e40

Browse files
committed
Github REST API does not provide old file names.
1 parent 146b72c commit b5e9e40

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

.github/workflows/preview-build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
added_files: ${{ steps.check-files.outputs.added_files }}
121121
modified_files: ${{ steps.check-files.outputs.modified_files }}
122122
deleted_files: ${{ steps.check-files.outputs.deleted_files }}
123-
renamed_files: ${{ steps.check-files.outputs.all_old_new_renamed_files }}
123+
renamed_files: ${{ steps.check-files.outputs.renamed_files }}
124124
steps:
125125
- name: Checkout
126126
if: contains(fromJSON('["push", "merge_group", "workflow_dispatch"]'), github.event_name)
@@ -133,8 +133,6 @@ jobs:
133133
id: check-files
134134
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
135135
with:
136-
old_new_files_separator: ':'
137-
include_all_old_new_renamed_files: 'true'
138136
files: ${{ inputs.path-pattern != '' && inputs.path-pattern || '**' }}
139137
files_ignore: |
140138
${{ inputs.path-pattern-ignore != '' && inputs.path-pattern-ignore || '' }}

src/tooling/docs-builder/Cli/DiffCommands.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ public async Task<int> ValidateRedirects([Argument] string? path = null, Cancel
6161
if (notFound is RenamedGitChange renamed)
6262
{
6363
collector.EmitError(redirectFileInfo.Name,
64-
$"File '{renamed.OldFilePath}' was renamed to '{renamed.NewFilePath}' but it has no redirect configuration set.");
64+
runningOnCi
65+
? $"A file was renamed to '{renamed.NewFilePath}' but it has no redirect configuration set."
66+
: $"File '{renamed.OldFilePath}' was renamed to '{renamed.NewFilePath}' but it has no redirect configuration set.");
6567
}
6668
else if (notFound.ChangeType is GitChangeType.Deleted)
6769
{

src/tooling/docs-builder/Tracking/IntegrationGitRepositoryTracker.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,8 @@ public IEnumerable<GitChange> GetChangedFiles()
3333
var renamedFiles = Environment.GetEnvironmentVariable("RENAMED_FILES");
3434
if (!string.IsNullOrEmpty(renamedFiles))
3535
{
36-
foreach (var pair in renamedFiles.Split(' ', StringSplitOptions.RemoveEmptyEntries).Where(f => f.StartsWith(LookupPath)))
37-
{
38-
var parts = pair.Split(':');
39-
if (parts.Length == 2)
40-
yield return new RenamedGitChange(parts[0], parts[1], GitChangeType.Renamed);
41-
}
36+
foreach (var file in renamedFiles.Split(' ', StringSplitOptions.RemoveEmptyEntries).Where(f => f.StartsWith(LookupPath)))
37+
yield return new RenamedGitChange(string.Empty, file, GitChangeType.Renamed);
4238
}
4339
}
4440
}

0 commit comments

Comments
 (0)