GitHub Actions - Do not run GitHub Action when certain files are updated

by
Jeremy Canfield |
Updated: May 05 2025
| GitHub Actions articles
GitHub Actions can be used to do something whenever something happens in one of your GitHub repositories. If you are not familiar with GitHub Actions, check out my article Getting Started with GitHub Actions.
Almost always, there will be certain files in your repos that when updated shouldn't trigger your GitHub Actions to run. paths-ignore can be used to instruct your GitHub Action to not run for certain files. In this example, the GitHub Action will NOT run if any .md file is updated such as README.md or any file in the .github/ directory.
name: deploy_changed_files
run-name: ${{ github.workflow }} run by ${{ github.actor }}
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '.github/**'
Did you find this article helpful?
If so, consider buying me a coffee over at