Skip to content

Commit

Permalink
feat: warn when since/until inputs are set but not corresponding sha …
Browse files Browse the repository at this point in the history
…is found
  • Loading branch information
jackton1 committed Sep 8, 2022
1 parent 4f7185f commit 0c9b5d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ runs:
# "Set base sha..."
if [[ -n "${{ inputs.since }}" ]]; then
BASE_SHA=$(git log --format="%H" --date=local --since="${{ inputs.since }}" --reverse | head -n 1)
if [[ -z "$BASE_SHA" ]]; then
echo "::warning::The BASE_SHA for date '${{ inputs.since }}' couldn't be determined."
fi
echo "::set-output name=base_sha::$BASE_SHA"
elif [[ -n "${{ inputs.base_sha }}" ]]; then
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
Expand All @@ -174,6 +177,9 @@ runs:
# "Set the sha..."
if [[ -n "${{ inputs.until }}" ]]; then
SHA=$(git log -1 --format="%H" --date=local --until="${{ inputs.until }}")
if [[ -z "$SHA" ]]; then
echo "::warning::The SHA for date '${{ inputs.until }}' couldn't be determined, falling back to the current sha."
fi
echo "::set-output name=sha::$SHA"
else
echo "::set-output name=sha::${{ inputs.sha }}"
Expand Down

0 comments on commit 0c9b5d5

Please sign in to comment.