Skip to content

Validate file exists

Actions
This GitHub Action validates the existence of a list of files when provided a comma separated list
v0.0.5
Latest
Star (2)

Validate File Exists

GitHub Super-Linter CI Check dist/ CodeQL Coverage Validate Repository Configuration

A GitHub Action that validates whether specified files exist in your repository. This action helps ensure that required files are present before proceeding with your workflow, which is useful for validation steps or pre-deployment checks.

Inputs

Input Description Required
required-files Comma-separated list of files to check for existence Yes

Outputs

Output Description
exists 'true' if all specified files exist

Usage

Basic Example

steps:
  - uses: actions/checkout@v4
  - name: Validate configuration files
    uses: chrisreddington/[email protected]
    with:
      files: README.md

Multiple Files Example

steps:
  - uses: actions/checkout@v4
  - name: Validate configuration files
    uses: chrisreddington/[email protected]
    with:
      files: 'README.md, .github/copilot-instructions.md'

Error Handling

If any of the specified files are missing, the action will:

  1. Fail with a detailed error message listing all missing files
  2. Exit with a non-zero status code, which will cause the workflow to fail

Example error message:

Error: The following files do not exist: config.json, settings.yml

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Validate file exists is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

This GitHub Action validates the existence of a list of files when provided a comma separated list
v0.0.5
Latest

Validate file exists is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.