Skip to content

DawChihLiou/changed-files-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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 }}"