Skip to content
git-pull-request

GitHub Action

List files changed in a Pull Request

1.1.4 Latest version

List files changed in a Pull Request

git-pull-request

List files changed in a Pull Request

For a given pull request number, list all the Python (.py) files added and modified

Installation

Copy and paste the following snippet into your .yml file.

              

- name: List files changed in a Pull Request

uses: karpikpl/list-changed-files-action@1.1.4

Learn more about this action in karpikpl/list-changed-files-action

Choose a version

List files changed in a Pull Request

GitHub Super-Linter CI

GitHub Action that lists all files changed (were added, modified) in the provided pull request.

Usage

Basic

You need to add permissions for this tool.

permissions:
  contents: read
uses: karpikpl/list-changed-files-action@1.1.2

To get a list of Python files changed in a PR:

uses: karpikpl/list-changed-files-action@1.1.2
with:
  file-filter: '*.py'

Inputs

file-filter

Optional Glob file filter to apply on the changed files in the pull request. E.g. *.py. Default: no filter.

pull-number

Optional ID of the pull request. Action will try to use pull request number from GitHub event.

repo-owner

Optional Another repository owner, If not set, the current repository owner is used by default. Note that when you trying changing a repository, be aware that GITHUB_TOKEN should also have permission for that repository.

repo-name

Optional Another repository name. Of limited use on GitHub enterprise. If not set, the current repository is used by default. Note that when you trying changing a repository, be aware that GITHUB_TOKEN should also have permission for that repository.

repo-token

Optional, You can set PAT here. If not set, this will use ${{ github.token }}.

Outputs

changed_files

Space separated list of files changed (added, modified) in the pull request that match provided file-filter.

e.g. 'file1.py' 'file2.py'

head_sha

Head sha commit ID from the pull request.

base_sha

Base sha commit ID from the pull request.

result

The result of the action. Success, Failure or information message. Useful for debugging.