Skip to content

Commit

Permalink
Merge pull request #1 from rdietrick/status-args
Browse files Browse the repository at this point in the history
Add support for optional arguments to git status
  • Loading branch information
darrynten authored Jun 17, 2020
2 parents 49f636b + d99340e commit ea00e6f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 13 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ description: "Check if a git repository has uncommitted changes"
branding:
icon: "info"
color: "yellow"
inputs:
status-args:
description: "Arguments to the `git status` command."
required: false
default: ""
pathspec:
description: "Pattern used to limit paths in the `git status` command."
required: false
default: ""
outputs:
changed:
description: "Whether or not there are uncommitted changes in the folder"
description: "Whether or not there are uncommitted changes in the pathspec"
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.status-args }}
- ${{ inputs.pathspec }}
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
set -e

STATUS_ARGS=$1
PATHSPEC=$2

function check() {
if [[ -z "$(git status --porcelain)" ]];
if [[ -z "$(git status --porcelain $STATUS_ARGS $PATHSPEC)" ]];
then
echo "0"
else
Expand Down

0 comments on commit ea00e6f

Please sign in to comment.