Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warn when since/until inputs are set but not corresponding sha is found #620

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions action.yml
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