Browse Source

Fix daily date bump action

Scott Lahteine 5 years ago
parent
commit
57e37b6c24
2 changed files with 11 additions and 19 deletions
  1. 11 2
      .github/workflows/bump-date.yml
  2. 0 17
      buildroot/bin/bump_date

+ 11 - 2
.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

+ 0 - 17
buildroot/bin/bump_date

@@ -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)"