Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 56b90f2

Browse files
jorgectfbigdaz
authored andcommitted
Export failed wrapper(s) path to GITHUB_OUTPUT
1 parent 01ad6d2 commit 56b90f2

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ inputs:
1616
required: false
1717
default: ''
1818

19+
outputs:
20+
failed-wrapper:
21+
description: The path of the Gradle Wrapper(s) JAR that failed validation.
22+
1923
runs:
2024
using: 'node16'
2125
main: 'dist/index.js'

dist/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ async function run() {
212212
}
213213
else {
214214
core.setFailed(`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/wrapper-validation-action#reporting-failures\n${result.toDisplayString()}`);
215+
if (result.invalid.length > 0) {
216+
core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`);
217+
}
215218
}
216219
}
217220
catch (error) {

src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ export async function run(): Promise<void> {
1717
core.setFailed(
1818
`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/wrapper-validation-action#reporting-failures\n${result.toDisplayString()}`
1919
)
20+
if (result.invalid.length > 0) {
21+
core.setOutput(
22+
'failed-wrapper',
23+
`${result.invalid.map(w => w.path).join('|')}`
24+
)
25+
}
2026
}
2127
} catch (error) {
2228
if (error instanceof Error) {

0 commit comments

Comments
 (0)