mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Warn and make Gradle Wrapper script executable
Instead of failing the build, detect a non-executable wrapper file and set the executable bit. Fixes #17
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as path from 'path'
|
||||
import fs from 'fs'
|
||||
|
||||
@@ -37,6 +38,9 @@ function verifyIsExecutableScript(toExecute: string): void {
|
||||
try {
|
||||
fs.accessSync(toExecute, fs.constants.X_OK)
|
||||
} catch (err) {
|
||||
throw new Error(`Gradle script '${toExecute}' is not executable.`)
|
||||
core.warning(
|
||||
`Gradle wrapper script '${toExecute}' is not executable. Action will set executable permission and continue.`
|
||||
)
|
||||
fs.chmodSync(toExecute, '755')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user