2019-11-13 07:22:46 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
cd $(dirname "$0")/..
|
2019-12-11 08:01:23 +03:00
|
|
|
set_output () {
|
2019-11-13 07:22:46 +03:00
|
|
|
echo "$1=$2"
|
2019-12-11 08:01:23 +03:00
|
|
|
echo "::set-output name=$1::$2"
|
2019-11-13 07:22:46 +03:00
|
|
|
}
|
|
|
|
COMMIT_TIMESTAMP="$(git log -1 --format=%ct)"
|
2019-12-11 08:01:23 +03:00
|
|
|
set_output "COMMIT_TIMESTAMP" "$COMMIT_TIMESTAMP"
|
2019-11-13 07:22:46 +03:00
|
|
|
LOGS=$(TZ=UTC git log --since='0:00' --date=iso-local --format='%cd %s')
|
|
|
|
echo "commits of today:"
|
|
|
|
echo "$LOGS"
|
|
|
|
COUNT=$(echo "$LOGS" | wc -l)
|
|
|
|
# strip spaces
|
|
|
|
COUNT=$((0 + COUNT))
|
2019-12-11 08:01:23 +03:00
|
|
|
set_output "COMMIT_NUMBER_OF_DAY" "$COUNT"
|
|
|
|
set_output "COMMIT_DATE" "$(TZ=UTC git log --since='0:00' --date=short-local --format=%cd -1)"
|