Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

ZyAction: Verify Changed Files

v1.0.0

ZyAction: Verify Changed Files

check-square

ZyAction: Verify Changed Files

Verify file changes that occur during workflow execution

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ZyAction: Verify Changed Files

uses: zyactions/verify-changed-files@v1.0.0

Learn more about this action in zyactions/verify-changed-files

Choose a version

Verify Changed Files

License: MIT CI Ubuntu macOS Windows

A GitHub Action to verify file changes that occur during workflow execution.

Features

  • Lists all files that changed during a workflow execution
  • Supports glob patterns to restrict change detection to a subset of files
  • Fast execution
  • Scales to large repositories
  • Supports all platforms (Linux, macOS, Windows)
  • Does not use external dependencies

Usage

Detect changes to all files

steps:
  - name: Checkout
    uses: actions/checkout@v3.1.0

  - name: Change Files
    run: |
      echo "test" > test/new.txt
      echo "test" > unstaged.txt

  - name: Verify Changed Files
    id: verify-changes
    uses: zyactions/verify-changed-files@master

  - name: Run only if one of the files has changed
    if: steps.verify-changes.outputs.changed-files != ''
    run: |
      echo "Changed Files:"
      echo "${{ steps.verify-changes.outputs.changed-files }}"

  - name: Run only if 'unstaged.txt' has changed
    if: contains(steps.verify-changes.outputs.changed-files, 'unstaged.txt')
    run: |
      echo "Detected changes to 'unstaged.txt'"

Detect changes to specific files

steps:
  - name: Checkout
    uses: actions/checkout@v3.1.0
    # ...
  - name: Verify Changed Files
    id: verify-changes
    uses: zyactions/verify-changed-files@master
    with:
      path: |
        test/*
        unstaged.txt

Check out the glob pattern cheat sheet for reference. Multi line patterns must be specified without quotes.

Inputs

path:
  # A file, directory or wildcard pattern that describes which files to verify.
  # Supports multi-line strings. Matches all files, if set to the empty string.
  type: string
  default: '**/*'

separator:
  # A character- or string to be used to separate the individual file names in
  # the output list. Any filename containing this separator will be enclosed
  # in double quotes. Defaults to the newline character '\n', if set to the
  # empty string.
  type: string
  default: "\n"

exclude-ignored:
  # Whether to exclude '.gitignore' ignored files for added files detection.
  type: boolean
  default: true

Outputs

changed-files:
  # The list of all changed files, or an empty string.
  type: string

Dependencies

This action does not use external dependencies.

Note

Using external GitHub Actions dependencies within an action negates the security benefits of pinning to a specific commit hash if they (the dependencies) are not also pinned.

Versioning

Versions follow the semantic versioning scheme.

License

Verify Changed Files Action is licensed under the MIT license.