Skip to content

Commit 5b87bfb

Browse files
authored
Support onlyDiff=true
1 parent b7186f0 commit 5b87bfb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: entrypoint.sh

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ if [[ "${INPUT_PRESET}" ]]; then
3131
pint_command+=" --preset ${INPUT_PRESET}"
3232
fi
3333

34+
if [[ "${INPUT_ONLYDIFF}" == true ]]; then
35+
if [[ -n "${GITHUB_TOKEN}" ]]; then
36+
INPUT_ONLYDIFF=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
37+
"https://api.github.com/repos/${GITHUB_REPOSITORY}" | jq -r .default_branch)
38+
else
39+
INPUT_ONLYDIFF=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
40+
fi
41+
fi
42+
3443
if [[ "${INPUT_ONLYDIFF}" ]]; then
3544
pint_command+=" --diff=${INPUT_ONLYDIFF}"
3645
INPUT_ONLYDIRTY=false

0 commit comments

Comments
 (0)