Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andstor/file-existence-action
:file_folder: :octocat: GitHub Action to check for file existence
https://github.com/andstor/file-existence-action
hacktoberfest
Last synced: about 2 months ago
JSON representation
:file_folder: :octocat: GitHub Action to check for file existence
- Host: GitHub
- URL: https://github.com/andstor/file-existence-action
- Owner: andstor
- License: mit
- Created: 2020-02-28T14:16:08.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T17:07:58.000Z (6 months ago)
- Last Synced: 2024-05-15T13:14:05.883Z (4 months ago)
- Topics: hacktoberfest
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/file-existence
- Size: 404 KB
- Stars: 117
- Watchers: 5
- Forks: 33
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# file-existence-action
> GitHub Action to check for file existence
![build-test](https://github.com/andstor/file-existence-action/workflows/build/badge.svg)
This is a GitHub Action to check for the existence of files. It can be used for conditionally running workflow steps based on file(s) existence.
## Usage
The following example [workflow step](https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow) will check for existence of the files: `package.json`, `LICENSE`, `README.md`, `foo` `bar`
```yml
- name: "Check file existence"
uses: andstor/file-existence-action@v3
with:
files: "package.json, LICENSE, README.md, foo, *.txt"
```## Options ⚙️
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. 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`|
|`fail`|Optional|Makes the Action fail on missing files.|`false`|## Outputs
- `files_exists`: Outputs `true` if the file(s) exists, otherwise `false`.## Example
```yml
name: "File existence check"on: [push, pull_request]
jobs:
file_existence:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "package.json, LICENSE, README.md"- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
# Only runs if all of the files exists
run: echo All files exists!
```## License
Copyright © 2020 [André Storhaug](https://github.com/andstor)
file-existence-action is licensed under the [MIT License](https://github.com/andstor/file-existence-ation/blob/master/LICENSE).