From 57e37b6c24b2c8c27f95d8623931421d5f821149 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Jan 2020 17:47:48 -0600 Subject: [PATCH] Fix daily date bump action --- .github/workflows/bump-date.yml | 13 +++++++++++-- buildroot/bin/bump_date | 17 ----------------- 2 files changed, 11 insertions(+), 19 deletions(-) delete mode 100755 buildroot/bin/bump_date diff --git a/.github/workflows/bump-date.yml b/.github/workflows/bump-date.yml index df2ac5fbd..ad4b9ed1f 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 0 * * *' jobs: bump_date: @@ -22,4 +22,13 @@ jobs: ref: bugfix-2.0.x - name: Bump Distribution Date - run: source ./buildroot/bin/bump_date + run: | + # Inline Bump Script + [[ "$GITHUB_ACTOR" == 'MarlinFirmware' ]] || exit 0 + DIST=$( date +"%Y-%m-%d" ) + eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/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 diff --git a/buildroot/bin/bump_date b/buildroot/bin/bump_date deleted file mode 100755 index 77df90bbd..000000000 --- a/buildroot/bin/bump_date +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# bump_date -# -# Bump the Distribution Date in Version.h -# - -VERSION_FILE=Marlin/src/inc/Version.h - -SED=$(which gsed || which sed) - -DIST=$( date +"%Y-%m-%d" ) - -eval "${SED} -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' $VERSION_FILE" || exit 1 - -git add "$VERSION_FILE" || exit 1 -git commit -m "[cron] Bump distribution date ($DIST)"