Skip to content

Commit ea00e6f

Browse files
authored
Merge pull request #1 from rdietrick/status-args
Add support for optional arguments to git status
2 parents 49f636b + d99340e commit ea00e6f

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ description: "Check if a git repository has uncommitted changes"
33
branding:
44
icon: "info"
55
color: "yellow"
6+
inputs:
7+
status-args:
8+
description: "Arguments to the `git status` command."
9+
required: false
10+
default: ""
11+
pathspec:
12+
description: "Pattern used to limit paths in the `git status` command."
13+
required: false
14+
default: ""
615
outputs:
716
changed:
8-
description: "Whether or not there are uncommitted changes in the folder"
17+
description: "Whether or not there are uncommitted changes in the pathspec"
918
runs:
1019
using: "docker"
1120
image: "Dockerfile"
21+
args:
22+
- ${{ inputs.status-args }}
23+
- ${{ inputs.pathspec }}

entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/bash
22
set -e
33

4+
STATUS_ARGS=$1
5+
PATHSPEC=$2
6+
47
function check() {
5-
if [[ -z "$(git status --porcelain)" ]];
8+
if [[ -z "$(git status --porcelain $STATUS_ARGS $PATHSPEC)" ]];
69
then
710
echo "0"
811
else

0 commit comments

Comments
 (0)