Skip to content
file-plus

GitHub Action

Changed Filenames

v1 Latest version

Changed Filenames

file-plus

Changed Filenames

GitHub Action to fetch changed filenames in pull pequests

Installation

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

              

- name: Changed Filenames

uses: DawChihLiou/changed-files-action@v1

Learn more about this action in DawChihLiou/changed-files-action

Choose a version

Changed Filenames GitHub Action

This action returns all changed files in a pull request. The changed files includes added, modified, renamed, and removed files.

  • 🦄 It is actively maintained
  • 💅 Minimalistic implementation
  • 🌈 PRs and discussion are welcomed

Inputs

Parameter Description Optional Default
token GitHub API Token secrets.GITHUB_TOKEN
output Output format string

Outputs

Property Description Type Default
filenames A list of filenames in the output format given in the input parameters string | JSON ""

Examples

Using The Default Parameters

The following usage will use the default GitHub token and return changed filenames in string format.

- uses: DawChihLiou/changed-files-action@v1

The output will look like this:

.github/workflows/ci.yaml src/index.js README.md

Using Custom Parameters

The following usage will use a custom GitHub toek and return changed filenames in JSON.

- uses: DawChihLiou/changed-files-action@v1
  with:
    token: ${{ secrets.YOUR_GITHUB_TOKEN }}
    output: 'json'

The output will look like this:

[".github/workflows/ci.yaml", "src/index.js", "README.md"]

Using the Action

- uses: DawChihLiou/changed-files@v1
  id: changed-files
  with:
    token: ${{ secrets.YOUR_GITHUB_TOKEN }}
    output: 'string'
- name: Echo files
  run: |
    echo "${{ steps.changed-files.outputs.filenames }}"