mirror of
https://github.com/gradle/wrapper-validation-action
synced 2024-11-23 17:22:01 +00:00
Export failed wrapper(s) path to GITHUB_OUTPUT
This commit is contained in:
parent
01ad6d2663
commit
56b90f209b
3 changed files with 13 additions and 0 deletions
|
@ -16,6 +16,10 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
failed-wrapper:
|
||||||
|
description: The path of the Gradle Wrapper(s) JAR that failed validation.
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -212,6 +212,9 @@ async function run() {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.setFailed(`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/wrapper-validation-action#reporting-failures\n${result.toDisplayString()}`);
|
core.setFailed(`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/wrapper-validation-action#reporting-failures\n${result.toDisplayString()}`);
|
||||||
|
if (result.invalid.length > 0) {
|
||||||
|
core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
|
@ -17,6 +17,12 @@ export async function run(): Promise<void> {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/wrapper-validation-action#reporting-failures\n${result.toDisplayString()}`
|
`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/wrapper-validation-action#reporting-failures\n${result.toDisplayString()}`
|
||||||
)
|
)
|
||||||
|
if (result.invalid.length > 0) {
|
||||||
|
core.setOutput(
|
||||||
|
'failed-wrapper',
|
||||||
|
`${result.invalid.map(w => w.path).join('|')}`
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
|
|
Loading…
Reference in a new issue