# Get Files Modified in a PR in GitHub Actions

DevFeed: [Get Files Modified in a PR in GitHub Actions](<https://devfeed.tech/articles/get-files-modified-in-a-pr-in-github-actions-4524.md>)

Original publisher: [Read original article](<https://feeds.feedblitz.com/~/923543417/0/baeldung/ops~Get-Files-Modified-in-a-PR-in-GitHub-Actions>)

Author: Christian Jaimes

Published: 2025-08-20T15:03:13Z

Content type: tutorial

Language: en

Sources: [Baeldung - Ops](<https://devfeed.tech/sources/baeldung-ops.md>)

Topics: [ci](<https://devfeed.tech/topics/ci.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [git](<https://devfeed.tech/tags/git.md>), [git-github-actions-pull-request](<https://devfeed.tech/tags/git-github-actions-pull-request.md>), [github](<https://devfeed.tech/tags/github.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

## AI overview

A tutorial on detecting files changed by pull requests and pushes in GitHub Actions. It covers comparing PR base and head branches with git diff, and using before-and-after commit SHAs for push events.

## Source excerpt

Learn how to detect changed files in a PR and on push using GitHub Actions. Related Stories Create Pull Request With GitHub Actions Using a Package Manager in GitHub Actions Use Private Docker Image in GitHub Actions