Skip to content

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

License

Notifications You must be signed in to change notification settings

zyactions/verify-changed-files

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published