Skip to content

Commit

Permalink
Deprecates the "allow_failure" variable in favor of "fail"
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
andstor committed Oct 24, 2022
1 parent bbb27a8 commit 3135985
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following input variables options can/must be configured:
|`files`|Required|Comma separated string with paths to files and directories to check for existence. Supports [glob paterns](https://github.com/isaacs/node-glob).||
|`ignore_case`|Optional|Ignore if a file name has upper or lower cases.|`true`|
|`follow_symbolic_links`|Optional|Indicates whether to follow symbolic links.|`true`|
|`allow_failure`|Optional|Makes the Action fail on missing files.|`false`|
|`fail`|Optional|Makes the Action fail on missing files.|`false`|

## Outputs
- `files_exists`: Outputs `true` if the file(s) exists, otherwise `false`.
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ inputs:
description: 'Indicates whether to follow symbolic links.'
default: true
required: false
allow_failure:
fail:
description: 'Makes the Action fail on missing files.'
default: false
required: false
allow_failure:
description: 'This variable is deprecated in favour of "fail".'
required: false
outputs:
files_exists:
description: 'Whether the file(s) exists or not.'
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const files = core.getInput('files', { required: true });
const failure = (core.getInput('allow_failure') || 'false').toUpperCase() === 'TRUE';
const allow_failure = (core.getInput('allow_failure') || 'false').toUpperCase() === 'TRUE';
if (core.getInput('allow_failure')) {
core.warning(`❗The "allow_failure" variable is deprecated in favor of "fail"`);
}
const failure = ((core.getInput('failure') || 'false').toUpperCase() === 'TRUE') || allow_failure;
const fileList = files
.split(',')
.map((item) => item.trim());
Expand Down
10 changes: 9 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ export async function checkExistence(pattern: string): Promise<boolean> {
async function run(): Promise<void> {
try {
const files: string = core.getInput('files', {required: true})
const failure: boolean =
const allow_failure: boolean =
(core.getInput('allow_failure') || 'false').toUpperCase() === 'TRUE'
if (core.getInput('allow_failure')) {
core.warning(
`❗The "allow_failure" variable is deprecated in favor of "fail"`
)
}
const failure: boolean =
(core.getInput('failure') || 'false').toUpperCase() === 'TRUE' ||
allow_failure
const fileList: string[] = files
.split(',')
.map((item: string) => item.trim())
Expand Down

0 comments on commit 3135985

Please sign in to comment.