GitHub Action to check for file existence
This is a GitHub Action to check for existence of files. It can be used for conditionally running workflow steps based on file(s) existence.
The following example workflow step will check for existence of the files: package.json
, LICENSE
, README.md
, foo
bar
- name: "Check file existence"
uses: devsamuelv/secret-existence@v1
with:
files: "package.json, LICENSE, README.md, foo, bar"
The following input variables options can/must be configured:
Input variable | Necessity | Description | Default |
---|---|---|---|
files |
Required | Comma separated string with paths to files and directories to check for existence. | |
secret_exists |
Optional | Makes the Action fail on missing files. | false |
secret_exists
: Outputstrue
if the file(s) exists, otherwisefalse
.
name: "File existence check"
on: [push, pull_request]
jobs:
file_existence:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Check file existence
id: check_files
uses: devsamuelv/[email protected]
with:
files: "package.json, LICENSE, README.md"
Copyright © 2020 André Storhaug
secret-existence-action is licensed under the MIT License.