Skip to content

A lightweight GitHub Action that retrieves the list of files changed in a pull request using the GitHub CLI.

Notifications You must be signed in to change notification settings

skroutz/action-changed-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Changed Files Action

A simple action that retrieves the list of changed files in a pull request using the GitHub CLI and filters them with inclusion/exclusion regex patterns.

Inputs

Name Description Required Default
include_regex File inclusion pattern as regex. Only files matching the regex will be returned. false (empty)
exclude_regex File exclusion pattern as regex. Files matching the regex will be ignored. false (empty)

Outputs

Name Description
all_changed_files A space-separated list of all added, copied, modified, renamed and removed files.
new_or_modified_files A space-separated list of all added, copied, modified or renamed files.
removed_files A space-separated list of all removed files.

Example Usage

on:
  pull_request:

jobs:
  example:
    runs-on: ubuntu-latest
    steps:

      - name: Get changed files
        id: changed-files
        uses: skroutz/action-changed-files@v2
        with:
          include_regex: .*\.js

      - name: Print changed files
        run: |
          echo "All changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
          echo "Number of changed files: ${{ steps.changed-files.outputs.all_changed_files_count }}"

How to release

git tag v1.1.0   (replace with the needed version)
git push origin v1.1.0 (replace with the needed version)

About

A lightweight GitHub Action that retrieves the list of files changed in a pull request using the GitHub CLI.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •