Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ jobs:
- name: 'Validate redirect rules'
if: >
env.MATCH == 'true'
&& ${{ hashFiles('docs/_redirects.yml', 'docs/redirects.yml') != '' }}
&& github.repository == 'elastic/docs-builder'
&& (
steps.deployment.outputs.result
Expand All @@ -315,7 +314,7 @@ jobs:
- name: 'Validate redirect rules'
if: >
env.MATCH == 'true'
&& ${{ hashFiles('docs/_redirects.yml', 'docs/redirects.yml') != '' }}
&& hashFiles('docs/_redirects.yml', 'docs/redirects.yml') != ''
&& (
github.repository != 'elastic/docs-builder'
&& (
Expand Down
5 changes: 5 additions & 0 deletions src/tooling/docs-builder/Cli/DiffCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public async Task<int> ValidateRedirects([Argument] string? path = null, Cancel
var sourceFile = buildContext.ConfigurationPath;
var redirectFileName = sourceFile.Name.StartsWith('_') ? "_redirects.yml" : "redirects.yml";
var redirectFileInfo = sourceFile.FileSystem.FileInfo.New(Path.Combine(sourceFile.Directory!.FullName, redirectFileName));
if (!redirectFileInfo.Exists)
{
await collector.StopAsync(ctx);
return 0;
}

var redirectFileParser = new RedirectFile(redirectFileInfo, buildContext);
var redirects = redirectFileParser.Redirects;
Expand Down
Loading