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

Latest commit

History

183 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

github-actiongithub-sponsor

Simple Diff

A super simple diff checker for your GitHub workflow.

Very simple, you provide the action with a path to a file or folder, and it tells you if the file was added, modified, removed, or renamed. It will also output the items name and previous name, particularly usefull if it was just renamed.

Table of Contents

Usage

- name: Simple Diffuses: mudlabs/simple-diff@v1.2.0with:
path: path/to/file 

Inputs

InputDescriptionDefault
pathSpecifies a path from the root of your repository to the file or folder you want to check. If not provided the action will try to find a path specification from the workflow file itself. The path can be a glob string.
strictSpecifies the action should fail if the path is not in the commits diff tree.true

Outputs

OutputTypeDescription
addedbooleanSpecifies the file or folder was just added.
modifiedbooleanSpecifies the file or folder was modified.
removedbooleanSpecifies the file or folder was removed.
renamedbooleanSpecifies the file or folder was renamed.
namestringSpecifies the name of the file or folder.
previousstringSpecifies the previous file name, or its name.

Example Case

You have a workflow that only runs on a push event to a file path. But you don't want it to run if the file was removed(deleted).

  • Note: In this example we do not specify the path property. If your workflow is conditioned to only run when changes to a given path occure, you don't need to provide the action with the file path. (assuming that's the file path you want to check).
name: My File Workflowon:
push:
paths:
- path/to/my/file.extjobs:
diff:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: Simple Diffuses: mudlabs/simple-diff@v1.2.0id: diff
- run: exit 1if: steps.diff.outputs.removed == true# Other jobs will run only if file.ext was NOT removed.

About

A super simple diff checker for your GitHub workflow.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages