Skip to content

Commit

Permalink
Export failed wrapper(s) path to GITHUB_OUTPUT
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgectf authored and bigdaz committed Jul 21, 2023
1 parent 01ad6d2 commit 56b90f2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
required: false
default: ''

outputs:
failed-wrapper:
description: The path of the Gradle Wrapper(s) JAR that failed validation.

runs:
using: 'node16'
main: 'dist/index.js'
Expand Down
3 changes: 3 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ async function run() {
}
else {
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) {
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export async function run(): Promise<void> {
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) {
if (error instanceof Error) {
Expand Down

0 comments on commit 56b90f2

Please sign in to comment.