Skip to content
check-square

GitHub Action

ZyAction: Verify Changed Files

v2.0.1 Latest version

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@v2.0.1

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
  • 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

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

  - name: Get Changed Files
    id: verify-changes
    uses: zyactions/verify-changed-files@v2

  - 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
    # ...
  - name: Get Changed Files
    id: stage1
    uses: zyactions/verify-changed-files@v2
    with:
      return-pipe: true

  - name: Filter Results
    id: stage2
    uses: zyactions/glob@v2
    with:
      pattern: |
        test/*
        unstaged.txt
      pipe: ${{ steps.stage1.outputs.pipe }}

  - name: Print
    run: |
      echo "Changed Files:"
      echo "${{ steps.stage2.outputs.matches }}"

Check out the glob cheat sheet or the zyactions/glob action for further details.

Inputs

exclude-ignored

Configures the action to exclude .gitignore ignored files for added files detection. This option is enabled by default.

return-pipe

Enable this option to return a shell (bash) command in the pipe output that can be used for piping.

The output command must be evaled to return the results. It can also be passed to other actions that support a pipe input.

Note: The changed-files output will not be populated if this option is enabled.

Outputs

changed-files

This output contains all files detected by the action, separated by the configured separator. Contains the empty string if no changes were detected.

Note: This output is only available if the return-pipe option is not enabled.

pipe

A shell (bash) command which can be used for piping.

Note: This output is only available if the return-pipe option is enabled.

Dependencies

Actions

This action does not use external GitHub Actions dependencies.

Versioning

Versions follow the semantic versioning scheme.

License

Verify Changed Files Action is licensed under the MIT license.