Skip to content

Commit 4462d16

Browse files
committed
BREAKING CHANGE: rename TYPE to TOOLCHAIN
1 parent 09534c4 commit 4462d16

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ branding:
77
color: blue
88

99
inputs:
10-
TYPE:
10+
TOOLCHAIN:
1111
description: Possible values - 'respec', 'bikeshed'
1212
SOURCE:
1313
description: Source file path.
@@ -51,7 +51,7 @@ runs:
5151
echo "::endgroup::"
5252
shell: bash
5353
env:
54-
INPUTS_TYPE: ${{ fromJson(steps.prepare.outputs.all).type }}
54+
INPUTS_TOOLCHAIN: ${{ fromJson(steps.prepare.outputs.all).toolchain }}
5555
HOME: /home/runner
5656

5757
- name: Generate Static HTML
@@ -62,7 +62,7 @@ runs:
6262
echo "::endgroup::"
6363
shell: bash
6464
env:
65-
INPUTS_TYPE: ${{ fromJson(steps.prepare.outputs.all).type }}
65+
INPUTS_TOOLCHAIN: ${{ fromJson(steps.prepare.outputs.all).toolchain }}
6666
INPUTS_SOURCE: ${{ fromJson(steps.prepare.outputs.all).source }}
6767

6868
- name: Validate hyperlinks

build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
// @ts-check
22
const { env, exit, setOutput, sh } = require("./utils.js");
33

4-
const type = env("INPUTS_TYPE");
4+
const toolchain = env("INPUTS_TOOLCHAIN");
55
const source = env("INPUTS_SOURCE");
66

77
// Please do not rely on this value. If you would like this to be available as
88
// an action output, file an issue.
99
const outputFile = source + ".built.html";
1010

1111
(async () => {
12-
switch (type) {
12+
switch (toolchain) {
1313
case "respec":
1414
console.log(`Converting ReSpec document '${source}' to HTML...`);
1515
return await sh(`respec -s "${source}" -o "${outputFile}"`, "stream");
1616
case "bikeshed":
1717
console.log(`Converting Bikeshed document '${source}' to HTML...`);
1818
return await sh(`bikeshed spec "${source}" "${outputFile}"`, "stream");
1919
default:
20-
throw new Error(`Unknown "type": "${type}"`);
20+
throw new Error(`Unknown "TOOLCHAIN": "${toolchain}"`);
2121
}
2222
})()
2323
.then(() => setOutput("output", outputFile))

docs/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
## Specify toolchain: Bikeshed or ReSpec
4343
44-
Provide `TYPE` if the action cannot figure out the toolchain itself, or if you like to be explicit.
44+
Specify `TOOLCHAIN` if the action cannot figure out the toolchain itself, or if you like to be explicit.
4545

4646
```yaml
4747
# .github/workflows/pr.yml
@@ -56,7 +56,7 @@ jobs:
5656
- uses: actions/checkout@v2
5757
- uses: sidvishnoi/w3c-deploy@v1
5858
with:
59-
TYPE: respec # or bikeshed
59+
TOOLCHAIN: respec # or bikeshed
6060
```
6161

6262
## Deploy to GitHub pages

docs/options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
## Table of Contents
44

5-
- General: [`TYPE`](#type), [`SOURCE`](#source)
5+
- General: [`TOOLCHAIN`](#toolchain), [`SOURCE`](#source)
66
- Validation: [`VALIDATE_LINKS`](#validate_links), [`VALIDATE_MARKUP`](#validate_markup)
77
- GitHub Pages: [`GH_PAGES_BRANCH`](#gh_pages_branch), [`GH_PAGES_TOKEN`](#gh_pages_token)
88
- W3C Publish\*: [`W3C_ECHIDNA_TOKEN`](#w3c_echidna_token), [`W3C_MANIFEST_URL`](#w3c_manifest_url), [`W3C_WG_DECISION_URL`](#w3c_wg_decision_url), [`W3C_NOTIFICATIONS_CC`](#w3c_notifications_cc)
99

1010
\*W3C Publish: Using Echidna. Presently only supported with ReSpec.
1111

12-
## `TYPE`
12+
## `TOOLCHAIN`
1313

14-
Toolchain type.
14+
Toolchain to use.
1515

1616
**Possible values:** `respec`, `bikeshed`.
1717

@@ -23,7 +23,7 @@ Source file path.
2323

2424
**Possible values:** Any valid POSIX file path relative to repository root.
2525

26-
**Default:** None. Inferred from `TYPE`: `index.html`/`index.bs` if exists.
26+
**Default:** None. Inferred from `TOOLCHAIN`: `index.html`/`index.bs` if exists.
2727

2828
## `VALIDATE_LINKS`
2929

prepare.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async function main() {
3232

3333
/**
3434
* @typedef {object} Inputs
35-
* @property {"respec" | "bikeshed"} [inputs.TYPE]
35+
* @property {"respec" | "bikeshed"} [inputs.TOOLCHAIN]
3636
* @property {string} [inputs.SOURCE]
3737
* @property {string} [inputs.VALIDATE_LINKS]
3838
* @property {string} [inputs.VALIDATE_MARKUP]
@@ -58,7 +58,7 @@ async function main() {
5858
*/
5959
async function processInputs(inputs, githubContext) {
6060
return {
61-
...typeAndInput(inputs),
61+
...toolchainAndSource(inputs),
6262
validate: validation(inputs),
6363
deploy: {
6464
ghPages: githubPagesDeployment(inputs, githubContext),
@@ -68,48 +68,48 @@ async function processInputs(inputs, githubContext) {
6868
}
6969

7070
/**
71-
* Figure out "type" and "source".
71+
* Figure out "toolchain" and input "source".
7272
* @param {Inputs} inputs
7373
*/
74-
function typeAndInput(inputs) {
75-
let type = inputs.TYPE;
74+
function toolchainAndSource(inputs) {
75+
let toolchain = inputs.TOOLCHAIN;
7676
let source = inputs.SOURCE;
7777

78-
if (type) {
79-
switch (type) {
78+
if (toolchain) {
79+
switch (toolchain) {
8080
case "respec":
8181
source = source || "index.html";
8282
break;
8383
case "bikeshed":
8484
source = source || "index.bs";
8585
break;
8686
default:
87-
exit(`Invalid input "type": ${type}`);
87+
exit(`Invalid input "TOOLCHAIN": ${toolchain}`);
8888
}
8989
} else if (!source) {
90-
exit(`Either of "type" or "source" must be provided.`);
90+
exit(`Either of "TOOLCHAIN" or "SOURCE" must be provided.`);
9191
}
9292

9393
if (!existsSync(source)) {
9494
exit(`"source" file "${source}" not found.`);
9595
}
9696

97-
if (!type) {
97+
if (!toolchain) {
9898
switch (source) {
9999
case "index.html":
100-
type = "respec";
100+
toolchain = "respec";
101101
break;
102102
case "index.bs":
103-
type = "bikeshed";
103+
toolchain = "bikeshed";
104104
break;
105105
default:
106106
exit(
107-
`Failed to figure out "type" from "source". Please specify the "type".`,
107+
`Failed to figure out "TOOLCHAIN" from "SOURCE". Please specify the "TOOLCHAIN".`,
108108
);
109109
}
110110
}
111111

112-
return { type, source };
112+
return { toolchain, source };
113113
}
114114

115115
/**

setup.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -e
3-
if [ -z "$INPUTS_TYPE" ]; then
4-
echo "Envirnoment variable \"INPUTS_TYPE\" must be set."
3+
if [ -z "$INPUTS_TOOLCHAIN" ]; then
4+
echo "Envirnoment variable \"INPUTS_TOOLCHAIN\" must be set."
55
exit 1
66
fi
77

@@ -12,7 +12,7 @@ echo "::set-env name=PUPPETEER_EXECUTABLE_PATH::/usr/bin/google-chrome"
1212
export PATH=$HOME/.local/bin:$PATH
1313
echo "::add-path::$HOME/.local/bin"
1414

15-
case $INPUTS_TYPE in
15+
case $INPUTS_TOOLCHAIN in
1616
respec)
1717
echo "Installing ReSpec..."
1818
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1

0 commit comments

Comments
 (0)