Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

changed-files

> DevOps
Open source

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

2.7K stars0 likes1 views
WebsiteGitHub

About

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

changed-files

Effortlessly track all changed files and directories relative to a target branch, the current branch (preceding commit or the last remote commit), multiple branches, or custom commits returning relative paths from the project root using this GitHub action.

[!NOTE]

  • This action solely identifies files that have changed for events such as pull_request*, push, merge_group, release, and many more. However, it doesn't detect pending uncommitted changes created during the workflow execution.

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

Table of contents

  • Features
  • Usage
    • On pull_request
      • Using local .git directory
      • Using Github's API :octocat:
    • On push ⬆️
    • Other supported events :electron:
  • Inputs ⚙️
  • Useful Acronyms
  • Outputs
  • Versioning ️
  • Examples
  • Real-world usage
    • Open source projects
    • Scalability Example
  • Important Notice ⚠️
  • Migration guide
  • Credits
  • Report Bugs
  • Contributors ✨
  • Automate Your Job Search Too

Features

  • Fast execution, averaging 0-10 seconds.
  • Leverages either Github's REST API or Git's native diff command to determine changed files.
  • Facilitates easy debugging.
  • Scales to handle large/mono repositories.
  • Supports Git submodules.
  • Supports merge queues for pull requests.
  • Generates escaped JSON output for running matrix jobs based on changed files.
  • Lists changed directories.
    • Limits matching changed directories to a specified maximum depth.
    • Optionally excludes the current directory.
  • Writes outputs to a designated .txt or .json file for further processing.
  • Restores deleted files to their previous location or a newly specified location.
  • Supports fetching a fixed number of commits, which improves performance.
  • Compatible with all platforms (Linux, MacOS, Windows).
  • Supports GitHub-hosted runners.
  • Supports GitHub Enterprise Server.
  • Supports self-hosted runners.
  • Lists all files and directories that have changed:
    • Between the current pull request branch and the last commit on the target branch.
    • Between the last commit and the current pushed change.
    • Between the last remote branch commit and the current HEAD.
  • Restricts change detection to a subset of files and directories:
    • Provides boolean output indicating changes in specific files.
    • Uses Glob pattern matching.
      • Supports Globstar.
      • Supports brace expansion.
      • Supports negation.
    • Uses YAML syntax for specifying patterns.
      • Supports YAML anchors & aliases.
      • Supports YAML multi-line strings.

And many more...

Usage

[!IMPORTANT]

  • Push Events: When configuring actions/checkout, make sure to set fetch-depth to either 0 or 2, depending on your use case.
  • Mono Repositories: To avoid pulling the entire branch history, you can utilize the default actions/checkout's fetch-depth of 1 for pull_request events.
  • Quoting Multiline Inputs: Avoid using single or double quotes for multiline inputs. The value is already a string separated by a newline character. Refer to the Examples section for more information.
  • Credentials Persistence: If fetch-depth is not set to 0, make sure to set persist-credentials to true when configuring actions/checkout.
  • Matching Files and Folders: To match all files and folders under a directory, this requires a globstar pattern e.g. dir_name/** which matches any number of subdirectories and files.

Visit the discussions for more information or create a new discussion for usage-related questions.

On pull_request

Detect changes to all files in a Pull request relative to the target branch or since the last pushed commit.

Using local .git directory

…

Using Github's API :octocat:

…

On push ⬆️

Detect changes to files made since the last pushed commit.

…

Other supported events :electron:

  • schedule
  • release
  • workflow_dispatch
  • workflow_run
  • merge_group
  • issue_comment
  • ...and many more

To access more examples, navigate to the Examples section.

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

Support this project with a :star:

Buy me a coffee

[!IMPORTANT]

  • When using files_yaml* inputs:
    • All keys must start with a letter or _ and contain only alphanumeric characters, -, or _.

      For example, test or test_key or test-key or _test_key are all valid choices.

Inputs ⚙️

…

Useful Acronyms

Acronym Meaning
A Added
C Copied
M Modified
D Deleted
R Renamed
T Type changed
U Unmerged
X Unknown

[!IMPORTANT]

  • When using files_yaml* inputs:
    • it's required to prefix all outputs with the key to ensure that the correct outputs are accessible.

      For example, if you use test as the key, you can access outputs like added_files, any_changed, and so on by prefixing them with the key test_added_files or test_any_changed etc.

Outputs

OUTPUT TYPE DESCRIPTION
added_files string Returns only files that are
Added (A).
added_files_count string Returns the number of added_files
all_changed_and_modified_files string Returns all changed and modified
files i.e. a combination of
(ACMRDTUX)
all_changed_and_modified_files_count string Returns the number of all_changed_and_modified_files
all_changed_files string Returns all changed files i.e.
a combination of all added,
copied, modified and renamed files
(ACMR)
all_changed_files_count string

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptactionschange-detectionchange-detetionchanged-file

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理