Add check for changes in master branch

This commit is contained in:
akloeckner 2021-05-10 09:33:11 +00:00
父節點 6101171a2f
當前提交 224d68233d
共有 1 個檔案被更改,包括 13 行新增0 行删除

查看文件

@ -0,0 +1,13 @@
#!/usr/bin/env bash
commitdate=$(curl -sL "https://api.github.com/repos/resoai/TileBoard/commits/master" | jq -r ".commit.author.date")
commitdays=$(( ( $(date --utc +%s) - $(date --utc -d $commitdate +%s) ) / 86400 ))
echo "Last commit was $commitdays days ago."
if [ $commitdays -lt 2 ] ; then
echo "There ARE recent changes in the repository."
else
echo "There are NO recent changes in the repository."
echo "Aborting pipeline."
exit 78 # drone.io exit code to stop but success the pipeline
fi