From db4172b5fa05e818f42427001398db5f13d13024 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 16 Jan 2022 00:54:53 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Prevent=20two=20[cron]=20in=20a?= =?UTF-8?q?=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/bump-date.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml index a1942777d1..5539941ed1 100644 --- a/.github/workflows/bump-date.yml +++ b/.github/workflows/bump-date.yml @@ -7,7 +7,7 @@ name: Bump Distribution Date on: schedule: - - cron: '0 0 * * *' + - cron: '0 */6 * * *' jobs: bump_date: @@ -26,11 +26,13 @@ jobs: - name: Bump Distribution Date run: | # Inline Bump Script - DIST=$( date +"%Y-%m-%d" ) - eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \ - eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \ - git config user.name "${GITHUB_ACTOR}" && \ - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ - git add . && \ - git commit -m "[cron] Bump distribution date ($DIST)" && \ - git push + if [[ ! "$( git log -1 --pretty=%B )" =~ ^\[cron\] ]]; then + DIST=$( date +"%Y-%m-%d" ) + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \ + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/Version.h" && \ + git config user.name "${GITHUB_ACTOR}" && \ + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ + git add . && \ + git commit -m "[cron] Bump distribution date ($DIST)" && \ + git push + fi