Skip to content

Commit ff1f9b4

Browse files
refactor: reword baseline to better understand prebuilt-tag
Signed-off-by: Coelacanthus <uwu@coelacanthus.name>
1 parent 3f36e5e commit ff1f9b4

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ inputs:
1111
path:
1212
description: 'Path to the code to format'
1313
default: '${{ github.workspace }}'
14-
baseline:
15-
description: 'Baseline version of "muttleyxd/clang-tools-static-binaries" (e.g., latest, master-<version>)'
14+
prebuilt-tag:
15+
description: 'Release tag of "muttleyxd/clang-tools-static-binaries" (e.g., latest, master-<version>)'
1616
default: 'latest'
1717
version:
1818
description: 'clang-format version to use (10 or higher)'

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/inputs.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getBooleanInput, getInput } from '@actions/core'
33

44
export interface Inputs {
55
readonly path: string
6-
readonly baseline: string
6+
readonly prebuiltTag: string
77
readonly version: string
88
readonly style: string
99
readonly fallbackStyle: string
@@ -13,13 +13,13 @@ export interface Inputs {
1313
}
1414

1515
export function getInputs(): Inputs {
16-
const baseline = getInput('baseline', { required: true, trimWhitespace: true })
16+
const prebuiltTag = getInput('prebuilt-tag', { required: true, trimWhitespace: true })
1717
const version = getInput('version', { required: true, trimWhitespace: true })
18-
assertBaseline(baseline)
18+
assertBaseline(prebuiltTag)
1919
assertVersion(version)
2020
return Object.freeze({
2121
path: resolve(getInput('path', { required: true, trimWhitespace: true })),
22-
baseline,
22+
prebuiltTag,
2323
version,
2424
style: getInput('style', { required: true, trimWhitespace: true }),
2525
fallbackStyle: getInput('fallback-style', { required: true, trimWhitespace: true }),
@@ -34,10 +34,10 @@ export function getInputs(): Inputs {
3434
})
3535
}
3636

37-
function assertBaseline(baseline: string): void {
38-
if (baseline === 'latest') return
39-
if (baseline.startsWith('master-')) return
40-
throw new Error('The baseline must be "latest" or "master-<version>"')
37+
function assertBaseline(prebuiltTag: string): void {
38+
if (prebuiltTag === 'latest') return
39+
if (prebuiltTag.startsWith('master-')) return
40+
throw new Error('The prebuilt-tag must be "latest" or "master-<version>"')
4141
}
4242

4343
function assertVersion(version: string): void {

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function getClangFormatBlobURL(inputs: Inputs): string {
1717
'muttleyxd',
1818
'clang-tools-static-binaries',
1919
'releases',
20-
inputs.baseline,
20+
inputs.prebuiltTag,
2121
'download',
2222
`clang-format-${inputs.version}_${getPlatform()}`,
2323
)

0 commit comments

Comments
 (0)