diff options
author | Kazuhiro NISHIYAMA <zn@mbf.nifty.com> | 2019-11-13 13:22:46 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <znz@users.noreply.github.com> | 2019-11-13 14:25:30 +0900 |
commit | c4064aef7f48c51add6c24467da64528d5a2a2a5 (patch) | |
tree | 134aa00f4a741a5a0112ccdcb38ba307c96fe78b /tool | |
parent | 245977b2861f5fa6a7341333ca9b1897e959489b (diff) | |
download | bundler-c4064aef7f48c51add6c24467da64528d5a2a2a5.tar.gz |
Add commit number of today to notification of GitHub Actions
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/actions-commit-info.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tool/actions-commit-info.sh b/tool/actions-commit-info.sh new file mode 100755 index 0000000000..c44f7d43f3 --- /dev/null +++ b/tool/actions-commit-info.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -euo pipefail +cd $(dirname "$0")/.. +set_env () { + echo "$1=$2" + echo "::set-env name=$1::$2" +} +COMMIT_TIMESTAMP="$(git log -1 --format=%ct)" +set_env "COMMIT_TIMESTAMP" "$COMMIT_TIMESTAMP" +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)) +set_env "COMMIT_NUMBER_OF_DAY" "$COUNT" +set_env "COMMIT_DATE" "$(TZ=UTC git log --since='0:00' --date=short-local --format=%cd -1)" |