mirror of
https://github.com/tj-actions/changed-files
synced 2025-01-30 19:30:19 +00:00
Merge pull request #620 from tj-actions/feat/warn-when-since/until-inputs-are-set-but-not-corresponding-sha-is-found
This commit is contained in:
commit
840016d287
1 changed files with 6 additions and 0 deletions
|
@ -158,6 +158,9 @@ runs:
|
||||||
# "Set base sha..."
|
# "Set base sha..."
|
||||||
if [[ -n "${{ inputs.since }}" ]]; then
|
if [[ -n "${{ inputs.since }}" ]]; then
|
||||||
BASE_SHA=$(git log --format="%H" --date=local --since="${{ inputs.since }}" --reverse | head -n 1)
|
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"
|
echo "::set-output name=base_sha::$BASE_SHA"
|
||||||
elif [[ -n "${{ inputs.base_sha }}" ]]; then
|
elif [[ -n "${{ inputs.base_sha }}" ]]; then
|
||||||
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
|
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
|
||||||
|
@ -174,6 +177,9 @@ runs:
|
||||||
# "Set the sha..."
|
# "Set the sha..."
|
||||||
if [[ -n "${{ inputs.until }}" ]]; then
|
if [[ -n "${{ inputs.until }}" ]]; then
|
||||||
SHA=$(git log -1 --format="%H" --date=local --until="${{ inputs.until }}")
|
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"
|
echo "::set-output name=sha::$SHA"
|
||||||
else
|
else
|
||||||
echo "::set-output name=sha::${{ inputs.sha }}"
|
echo "::set-output name=sha::${{ inputs.sha }}"
|
||||||
|
|
Loading…
Reference in a new issue