From 4cd5d1075382504bee947852caffd0c71f87ea7f Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Mon, 24 Feb 2025 21:17:03 +0100 Subject: [PATCH 1/3] validate-inbound-local call docker image directly --- .github/workflows/preview-build.yml | 3 ++- actions/validate-inbound-local/action.yml | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 04543dd4e..2b6d63d6c 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -133,7 +133,8 @@ jobs: prefix: ${{ env.PATH_PREFIX }} strict: ${{ fromJSON(inputs.strict != '' && inputs.strict || 'true') }} - - uses: elastic/docs-builder/actions/validate-inbound-local@main + - name: 'Validate Inbound Links' + uses: elastic/docs-builder/actions/validate-inbound-local@main if: ${{ !cancelled() && (steps.deployment.outputs.result || (steps.check-files.outputs.any_changed == 'true' && github.event_name == 'merge_group')) }} - uses: elastic/docs-builder/.github/actions/aws-auth@main diff --git a/actions/validate-inbound-local/action.yml b/actions/validate-inbound-local/action.yml index 6ae079bc3..9d166c022 100644 --- a/actions/validate-inbound-local/action.yml +++ b/actions/validate-inbound-local/action.yml @@ -1,10 +1,12 @@ name: 'Validate Inbound Links' description: 'Validates all published cross links from all known repositories against local links.json' +inputs: + command: + description: 'The assembler command to run' + required: false + default: "link validate-inbound-local" + runs: - using: "composite" - steps: - - name: Validate Inbound Links - uses: elastic/docs-builder/actions/assembler@main - with: - command: "link validate-inbound-local" \ No newline at end of file + using: 'docker' + image: "docker://ghcr.io/elastic/docs-assembler:edge" From d438ed6e981b7cc5e2b58314d249eaa9e46c6ccd Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Mon, 24 Feb 2025 21:40:58 +0100 Subject: [PATCH 2/3] ensure we can locally call commands on the docker image of assembler too --- src/Elastic.Markdown/IO/Discovery/GitCheckoutInformation.cs | 2 ++ src/docs-assembler/Program.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Elastic.Markdown/IO/Discovery/GitCheckoutInformation.cs b/src/Elastic.Markdown/IO/Discovery/GitCheckoutInformation.cs index 548d561d1..c940b5bfa 100644 --- a/src/Elastic.Markdown/IO/Discovery/GitCheckoutInformation.cs +++ b/src/Elastic.Markdown/IO/Discovery/GitCheckoutInformation.cs @@ -84,6 +84,8 @@ public static GitCheckoutInformation Create(IDirectoryInfo source, IFileSystem f remote = "elastic/docs-builder-unknown"; remote = remote.AsSpan().TrimEnd("git").TrimEnd('.').ToString(); + if (remote.EndsWith("docs-conten")) + remote += "t"; return new GitCheckoutInformation { diff --git a/src/docs-assembler/Program.cs b/src/docs-assembler/Program.cs index e0fc87bca..afd775857 100644 --- a/src/docs-assembler/Program.cs +++ b/src/docs-assembler/Program.cs @@ -25,7 +25,7 @@ app.Add("repo"); var githubActions = ConsoleApp.ServiceProvider.GetService(); -var command = githubActions?.GetInput("COMMAND"); +var command = githubActions?.GetInput("COMMAND") ?? Environment.GetEnvironmentVariable("INPUT_COMMAND"); if (!string.IsNullOrEmpty(command)) args = command.Split(' '); From 309350b66fd101422ffcf6d3b962f17a1d84f8d5 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Mon, 24 Feb 2025 21:43:14 +0100 Subject: [PATCH 3/3] revert changes to github actions it pulls the right image --- actions/validate-inbound-local/action.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/actions/validate-inbound-local/action.yml b/actions/validate-inbound-local/action.yml index 9d166c022..6ae079bc3 100644 --- a/actions/validate-inbound-local/action.yml +++ b/actions/validate-inbound-local/action.yml @@ -1,12 +1,10 @@ name: 'Validate Inbound Links' description: 'Validates all published cross links from all known repositories against local links.json' -inputs: - command: - description: 'The assembler command to run' - required: false - default: "link validate-inbound-local" - runs: - using: 'docker' - image: "docker://ghcr.io/elastic/docs-assembler:edge" + using: "composite" + steps: + - name: Validate Inbound Links + uses: elastic/docs-builder/actions/assembler@main + with: + command: "link validate-inbound-local" \ No newline at end of file