Skip to content

Commit 5cf6473

Browse files
authored
fix: don't break with multiple specs, add ARTIFACT_NAME option (#180)
1 parent 071d7eb commit 5cf6473

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ inputs:
1313
description: Source file path.
1414
DESTINATION:
1515
description: Destination path, relative to repository root.
16+
ARTIFACT_NAME:
17+
description: Name for build artifact. Required when building multiple documents in same job.
18+
default: "spec-prod-result"
1619
BUILD_FAIL_ON:
1720
description: Exit behaviour on errors.
1821
default: fatal
@@ -123,7 +126,7 @@ runs:
123126
path: |-
124127
${{ steps.build.outputs.gh && fromJson(steps.build.outputs.gh).dest }}
125128
${{ steps.build.outputs.w3c && fromJson(steps.build.outputs.w3c).dest }}
126-
name: spec-prod-result
129+
name: ${{ inputs.ARTIFACT_NAME }}
127130
retention-days: 5
128131

129132
- name: Validate hyperlinks

docs/examples.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,23 @@ jobs:
184184
max-parallel: 1
185185
matrix:
186186
include:
187-
- source: spec.html
187+
- name: spec-0
188+
source: spec.html
188189
destination: index.html
189190
echidna_token: ECHIDNA_TOKEN_SPEC
190-
- source: spec-1
191+
- name: spec-1
192+
source: spec-1
191193
destination: the-spec
192194
echidna_token: ECHIDNA_TOKEN_SPEC1
193-
- source: spec-2
195+
- name: spec-2
196+
source: spec-2
194197
# destination defaults to spec-2/index.html
195198
# echidna_token defaults to no publication to w3.org/TR
196199
steps:
197200
- uses: actions/checkout@v4
198201
- uses: w3c/spec-prod@v2
199202
with:
203+
ARTIFACT_NAME: ${{ matrix.name }} # required when building multiple documents in same job
200204
SOURCE: ${{ matrix.source }}
201205
DESTINATION: ${{ matrix.destination }}
202206
GH_PAGES_BRANCH: gh-pages

docs/options.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ Location of generated HTML document and other assets. This is useful when you've
3232
| `my-spec-src` | `my-spec-out` | `./my-spec-out/index.html` | `./my-spec-out/` |
3333
| `index.html` | `index.html` | `./index.html` | `./` |
3434

35+
## `ARTIFACT_NAME`
36+
37+
Name for artifact which will be uploaded to workflow run. Required when building multiple documents in same job.
38+
39+
**Possible values:** Any valid artifact name.
40+
41+
**Default:** `"spec-prod-result"`.
42+
3543
## `BUILD_FAIL_ON`
3644

3745
Define exit behaviour on build errors or warnings.

0 commit comments

Comments
 (0)