DEV.co
Open-Source DevOps · tj-actions

changed-files

changed-files is a GitHub Action that detects which files and directories have been modified in a pull request or push event. It compares against a target branch or previous commits and outputs the results as lists, supporting large monorepos and offering glob pattern filtering.

Source: GitHub — github.com/tj-actions/changed-files
2.7k
GitHub stars
330
Forks
TypeScript
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorytj-actions/changed-files
Ownertj-actions
Primary languageTypeScript
LicenseMIT — OSI-approved
Stars2.7k
Forks330
Open issues25
Latest releasev47.0.6 (2026-04-18)
Last updated2026-07-03
Sourcehttps://github.com/tj-actions/changed-files

What changed-files is

TypeScript-based GitHub Action leveraging Git's native diff commands or GitHub's REST API to identify changed files, with support for glob patterns, JSON/text output, directory traversal, and file restoration across Linux, macOS, and Windows runners.

Quickstart

Get the changed-files source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/tj-actions/changed-files.gitcd changed-files# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Conditional CI/CD pipeline execution

Run specific workflow jobs only when relevant files change (e.g., deploy backend only if src/backend/** modified).

Monorepo change detection and selective builds

Identify which package or service changed in a monorepo and trigger targeted test suites, builds, or deployments accordingly.

Lint and test specific file types

Run linters, tests, or validation only on changed TypeScript files, Python scripts, or configuration files to optimize CI runtime.

Implementation considerations

  • Configure actions/checkout fetch-depth appropriately: 0 for full history on push events, default 1 for pull requests on monorepos.
  • Use glob patterns (Globstar, brace expansion, negation) to fine-tune which files trigger downstream jobs and reduce unnecessary runs.
  • Enable persist-credentials: true in checkout if fetch-depth is not 0, ensuring Git operations can access remote branches.
  • Set JSON output format for complex matrix job generation; use .txt output for simple downstream job condition evaluation.
  • Test glob patterns locally or in a dev branch first—incorrect patterns may cause jobs to skip unexpectedly or match too broadly.

When to avoid it — and what to weigh

  • Need to detect uncommitted local changes — This action detects only committed changes in Git history; use tj-actions/verify-changed-files for pending uncommitted modifications.
  • Running on non-GitHub platforms — This is exclusively a GitHub Actions integration; it will not work on GitLab CI, CircleCI, Jenkins, or other CI/CD systems.
  • Shallow clones with insufficient fetch depth — Push events require fetch-depth of 0 or 2; monorepos need careful checkout configuration to avoid missing commit history.
  • Real-time file change streaming or webhooks — This is a synchronous action for workflow steps, not a streaming service or event-driven system for live file monitoring.

License & commercial use

MIT License—permissive open-source license allowing commercial use, modification, and redistribution with attribution and no warranty.

MIT license permits commercial use without restriction. No proprietary dependencies noted in provided data. Review project and any transitive dependencies for undisclosed restrictions before production deployment.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Action operates within GitHub Actions sandbox and accesses only local .git directory or GitHub's REST API using workflow-scoped tokens. No additional secrets or external network calls required. Review of transitive TypeScript dependencies and build process recommended before use in high-security environments.

Alternatives to consider

dorny/paths-filter

Alternative GitHub Action offering similar file change detection with glob filtering; compare feature parity and maintenance status for your use case.

GitHub's native path filters (if: contains(github.event.pull_request.title, 'keyword'))

Simpler but less powerful; use for basic branch/title-based conditionals when full file-level granularity is not needed.

Custom shell script + git diff/git log

Full control and no external action dependency; viable for simple two-branch comparisons but less maintainable for complex monorepos and cross-platform scenarios.

Software development agency

Build on changed-files with DEV.co software developers

Our DevOps engineers specialize in GitHub Actions automation, monorepo strategies, and optimized conditional workflows. Contact Devco to streamline your build pipelines today.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

changed-files FAQ

Why is my job not running even though I changed files matching my pattern?
Verify fetch-depth is set correctly (0 for push, persist-credentials: true if fetch-depth > 0), glob pattern syntax is correct, and the pattern is quoted properly (avoid single/double quotes for multiline). Test the pattern locally with git diff or glob testers.
Does this action detect uncommitted changes in my workflow?
No. It detects only committed changes in Git history. Use tj-actions/verify-changed-files to detect pending uncommitted modifications created during workflow execution.
Can I use this in a non-GitHub CI system?
No. This is a GitHub Actions integration. For GitLab CI, CircleCI, Jenkins, or other systems, use native equivalents (e.g., git diff, git show) or platform-specific actions.
What is the typical execution time?
Averages 0–10 seconds depending on repository size and number of changed files. Leverages Git native diff or GitHub REST API; both are fast for most repositories.

Work with a software development agency

Need help beyond evaluating changed-files? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source devops integrations — and maintain them long-term.

Need Expert Implementation of changed-files in Your CI/CD?

Our DevOps engineers specialize in GitHub Actions automation, monorepo strategies, and optimized conditional workflows. Contact Devco to streamline your build pipelines today.