Skip to content

This action check if a file or directory has differences.

License

Notifications You must be signed in to change notification settings

hyorimitsu/actions-check-diff

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check diff Action

This action check if a file or directory has differences.

Usage

If you want to check if some file has a difference, define a job like the following.

Note that multiple revisions must be fetch with actions/checkout's fetch-deps.

jobs:
  file-watch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: hyorimitsu/[email protected]
        id: diff
        name: diff
        with:
          target-branch: main
          target-file: test/file1.json
      - name: difference check
        if: steps.diff.outputs.file-diff > 0
        run: |
          echo 'test/file1.json is changed'

See here for other examples.

Input / Output parameters

The input parameters are as follows.

key required description
target-branch true The branch that triggers this action.
target-file false The path to the file where you want to check for differences.
target-dir false The path to the directory where you want to check for differences.

The output parameters are as follows.

key description
file-diff If over 0, there is a difference in the target-file.
dir-diff If over 0, there is a difference in the target-dir.

License

The scripts and documentation in this repository are released under the MIT License.

About

This action check if a file or directory has differences.

Resources

License

Stars

Watchers

Forks

Packages

No packages published