From 150ed92eb3d7b7bfd7a630d41f34373dd24b1308 Mon Sep 17 00:00:00 2001 From: Oliver Dunk Date: Tue, 16 Apr 2024 13:50:49 +0100 Subject: [PATCH 1/3] Add ARTIFACT_NAME option From v4, actions/upload-artifact requires each invocation to have a unique artifact name. Add a new input option to allow the name to be changed so spec-prod can be invoked multiple times. --- action.yml | 5 ++++- docs/examples.md | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index c377a7e..3756678 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,9 @@ inputs: description: Source file path. DESTINATION: description: Destination path, relative to repository root. + ARTIFACT_NAME: + description: Name for build artifact. + default: "spec-prod-result" BUILD_FAIL_ON: description: Exit behaviour on errors. default: fatal @@ -123,7 +126,7 @@ runs: path: |- ${{ steps.build.outputs.gh && fromJson(steps.build.outputs.gh).dest }} ${{ steps.build.outputs.w3c && fromJson(steps.build.outputs.w3c).dest }} - name: spec-prod-result + name: ${{ inputs.ARTIFACT_NAME }} retention-days: 5 - name: Validate hyperlinks diff --git a/docs/examples.md b/docs/examples.md index 98f4cb0..3ff121f 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -184,19 +184,23 @@ jobs: max-parallel: 1 matrix: include: - - source: spec.html + - name: spec-0 + source: spec.html destination: index.html echidna_token: ECHIDNA_TOKEN_SPEC - - source: spec-1 + - name: spec-1 + source: spec-1 destination: the-spec echidna_token: ECHIDNA_TOKEN_SPEC1 - - source: spec-2 + - name: spec-2 + source: spec-2 # destination defaults to spec-2/index.html # echidna_token defaults to no publication to w3.org/TR steps: - uses: actions/checkout@v4 - uses: w3c/spec-prod@v2 with: + ARTIFACT_NAME: ${{ matrix.name }} SOURCE: ${{ matrix.source }} DESTINATION: ${{ matrix.destination }} GH_PAGES_BRANCH: gh-pages From 025bc4dd2b6269e15c95c548c03a68388ca0c537 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:06:33 +0530 Subject: [PATCH 2/3] Apply suggestions from code review --- action.yml | 2 +- docs/examples.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3756678..9d6d801 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: DESTINATION: description: Destination path, relative to repository root. ARTIFACT_NAME: - description: Name for build artifact. + description: Name for build artifact. Required when building multiple documents in same job. default: "spec-prod-result" BUILD_FAIL_ON: description: Exit behaviour on errors. diff --git a/docs/examples.md b/docs/examples.md index 3ff121f..a8e8845 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -200,7 +200,7 @@ jobs: - uses: actions/checkout@v4 - uses: w3c/spec-prod@v2 with: - ARTIFACT_NAME: ${{ matrix.name }} + ARTIFACT_NAME: ${{ matrix.name }} # required when building multiple documents in same job SOURCE: ${{ matrix.source }} DESTINATION: ${{ matrix.destination }} GH_PAGES_BRANCH: gh-pages From 100c7b2039ebb92d15d6454c805243f5faf92f74 Mon Sep 17 00:00:00 2001 From: Oliver Dunk Date: Tue, 16 Apr 2024 15:44:14 +0100 Subject: [PATCH 3/3] Add ARTIFACT_NAME to options.md --- docs/options.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/options.md b/docs/options.md index 9459196..8b59e4a 100644 --- a/docs/options.md +++ b/docs/options.md @@ -32,6 +32,14 @@ Location of generated HTML document and other assets. This is useful when you've | `my-spec-src` | `my-spec-out` | `./my-spec-out/index.html` | `./my-spec-out/` | | `index.html` | `index.html` | `./index.html` | `./` | +## `ARTIFACT_NAME` + +Name for artifact which will be uploaded to workflow run. Required when building multiple documents in same job. + +**Possible values:** Any valid artifact name. + +**Default:** `"spec-prod-result"`. + ## `BUILD_FAIL_ON` Define exit behaviour on build errors or warnings.