• Stars
    star
    152
  • Rank 244,641 (Top 5 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

:octocat: Github action to verify file changes that occur during the workflow execution.

Ubuntu Mac OS Windows Public workflows that use this action.

Codacy Badge CI Update release version.

All Contributors

verify-changed-files

Verify that certain files or directories did or did not change during the workflow execution.

Warning:

  • This action only detects files that have pending uncommited changes generated during the workflow execution, for running a specific step when a file changes in a pull request or based on a pushed commit

    See: https://github.com/tj-actions/changed-files

Features

  • Fast execution (0-2 seconds on average).
  • Easy to debug.
  • Scales to large repositories.
  • Supports all platforms (Linux, MacOS, Windows).
  • GitHub-hosted runners support
  • GitHub Enterprise Server support.
  • self-hosted runners support.
  • Boolean output for detecting uncommited changes.
  • List all files that changed during the workflow execution.
  • Detect changes to track and untracked files.
  • Restrict change detection to a subset of files:

Usage

...
    steps:
      - uses: actions/checkout@v2

      - name: Change text file
        run: |
          echo "Modified" > new.txt

      - name: Change file in directory
        run: |
          echo "Changed" > test_directory/new.txt

      - name: Verify Changed files
        uses: tj-actions/verify-changed-files@v16
        id: verify-changed-files
        with:
          files: |
             *.txt
             test_directory
             action.yml
             **/*.py
             **/*.jpeg
             !*.sql

      - name: Run step only when any of the above files change.
        if: steps.verify-changed-files.outputs.files_changed == 'true'
        run: |
          echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"
        # Outputs: "Changed files: new.txt test_directory/new.txt"

Using the contains function.

...
      - name: Verify Changed files
        uses: tj-actions/verify-changed-files@v16
        id: verify-changed-files
        with:
          files: |
             new.txt
             test_directory

      - name: Perform action when test_directory changes
        if: contains(steps.verify-changed-files.outputs.changed_files, 'test_directory')
        run: |
          echo "test_directory has changed."

Get all unstaged (tracked/untracked) files

...
      - name: Verify Changed files
        uses: tj-actions/verify-changed-files@v16
        id: verify-changed-files
      
      - name: List all changed files tracked and untracked files
        run: |
          echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}"

If you feel generous and want to show some extra appreciation:

Support this project with a ⭐

Buy me a coffee

Inputs

INPUT TYPE REQUIRED DEFAULT DESCRIPTION
files string false File/Directory names to check for
uncommited changes.
files-separator string false "\n" Separator used to split the
files input
match-gitignore-files string true "false" Indicates whether to match files
in .gitignore
separator string false " " Output string separator.

Outputs

OUTPUT TYPE DESCRIPTION
changed_files string List of changed files
files_changed string Boolean indicating that files have
changed.

Known Limitation

Warning:

  • Using characters like \n, %, . and \r as output string separators would be URL encoded

Report Bugs

Report bugs at https://github.com/tj-actions/verify-changed-files/issues.

If you are reporting a bug, please include:

  • Your operating system name and version.
  • Any details about your workflow that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Max Kahnt

πŸ“–

William Killerud

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

changed-files

:octocat: Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
TypeScript
1,646
star
2

branch-names

:octocat: Github action to retrieve branch or tag names with support for all events.
204
star
3

eslint-changed-files

:octocat: Github action to run ESLint on changed pull request files with support for reporting errors via Github checks.
Shell
81
star
4

coverage-badge-go

:octocat: Generate coverage badge for go modules
Go
68
star
5

coverage-badge-py

:octocat: Github action to generate coverage badge without uploading results to a 3rd party.
Python
55
star
6

pg-dump

:octocat: Github action to generate backup of a postgres database.
Shell
42
star
7

auto-doc

:octocat: Github action that turns your reusable workflows and custom actions into easy to read markdown tables.
Go
37
star
8

puppeteer

:octocat: Github action to run test using Puppeteer, the headless chrome Node API
JavaScript
15
star
9

pg-restore

:octocat: Github action to restore a postgres database from a backup script.
10
star
10

git-cliff

:octocat: Github action to run git-cliff with a custom cliff.toml
Shell
8
star
11

docker-run

:octocat: GitHub action to run steps using docker
Dockerfile
7
star
12

depcheck

:octocat: Github action to validate unused node project dependencies.
Shell
7
star
13

github-changelog-generator

:octocat: Github action to generate CHANGELOG/HISTORY.md
Dockerfile
6
star
14

cargo-bump

:octocat: Github action that bumps the current version in your Cargo.toml
Rust
6
star
15

cookiecutter-action

:octocat: Cookiecutter for github actions
Dockerfile
5
star
16

coverage-reporter

:octocat: Github action to report code coverage for coverage.py, mocha, jest, etc.
TypeScript
5
star
17

renovate-config-validator

:octocat: Github action to validate renovate config
Dockerfile
5
star
18

aws-cdk

:octocat: Github action to run AWS CDK
Go
5
star
19

semver-diff

:octocat: Github action that compares versions based on the previous semantic version tag and the latest tag i.e (major, minor, patch, prerelease, build)
Shell
5
star
20

json2file

Simplifies the process of serializing JSON data to a file.
Rust
4
star
21

release-tagger

:octocat: Github action to manage action releases.
Shell
3
star
22

docker-cp

:octocat: Github action to run docker copy
Dockerfile
3
star
23

glob

:octocat: Github action to search for files matching glob patterns.
JavaScript
3
star
24

sync-release-version

:octocat: Github action to modify specific project files with an updated version of your project based on each release tag.
Shell
3
star
25

schemaspy

:octocat: Github action to document your database using https://schemaspy.org
Shell
3
star
26

vercel-wait

:octocat: Github action to wait for Vercel's automated deploys to enable triggering any dependent workflows.
Shell
3
star
27

gql-inspector

:octocat: Github action to compare GraphQL schemas, find breaking changes, find similar types.
TypeScript
2
star
28

remark

:octocat: Github action markdown processor https://github.com/remarkjs/remark
2
star
29

.github

tj-actions
2
star
30

coverage-badge-js

:octocat: Github action to generate coverage reports
TypeScript
2
star
31

bandit

:octocat: Github action to run PyCQA's bandit security linter.
Dockerfile
2
star
32

check-manifest

:octocat: Github action to detect any issues with your MANIFEST.in file used for distributing python packages
Python
2
star
33

checkly-trigger

:octocat: Github action to execute Checkly checks on-demand as part of your CI/CD pipeline or end-to-end tests
Shell
2
star
34

install-postgresql

:octocat: Github action to install PostgreSQL
Shell
2
star
35

demo

Submodule repo for changed-files action
1
star
36

tj-actions.github.io

tj-actions website
Vue
1
star
37

docker-action

A template to demonstrate how to build a Docker action.
Dockerfile
1
star
38

demo3

Demo repo with multiple commits to verify fork PR's for the changed-files action
Python
1
star
39

setup-bin

:octocat: Github action to download and install release artifacts for Golang and Rust
Shell
1
star
40

demo2

Demo repo with a single commit for the changed-files action
1
star
41

homebrew-tap

Homebrew tap
Ruby
1
star
42

find-changed-files

A github action to verify changed files.
Shell
1
star