Kaynağa Gözat

Fix daily date bump action

Scott Lahteine 4 yıl önce
ebeveyn
işleme
57e37b6c24
2 değiştirilmiş dosya ile 11 ekleme ve 19 silme
  1. 11
    2
      .github/workflows/bump-date.yml
  2. 0
    17
      buildroot/bin/bump_date

+ 11
- 2
.github/workflows/bump-date.yml Dosyayı Görüntüle

@@ -7,7 +7,7 @@ name: Bump Distribution Date
7 7
 
8 8
 on:
9 9
   schedule:
10
-    - cron:  '0 0 * * *'
10
+    - cron: '0 0 * * *'
11 11
 
12 12
 jobs:
13 13
   bump_date:
@@ -22,4 +22,13 @@ jobs:
22 22
         ref: bugfix-2.0.x
23 23
 
24 24
     - name: Bump Distribution Date
25
-      run: source ./buildroot/bin/bump_date
25
+      run: |
26
+        # Inline Bump Script
27
+        [[ "$GITHUB_ACTOR" == 'MarlinFirmware' ]] || exit 0
28
+        DIST=$( date +"%Y-%m-%d" )
29
+        eval "sed -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' Marlin/src/inc/Version.h" && \
30
+        git config user.name "${GITHUB_ACTOR}" && \
31
+        git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \
32
+        git add . && \
33
+        git commit -m "[cron] Bump distribution date ($DIST)" && \
34
+        git push

+ 0
- 17
buildroot/bin/bump_date Dosyayı Görüntüle

@@ -1,17 +0,0 @@
1
-#!/usr/bin/env bash
2
-#
3
-# bump_date
4
-#
5
-# Bump the Distribution Date in Version.h
6
-#
7
-
8
-VERSION_FILE=Marlin/src/inc/Version.h
9
-
10
-SED=$(which gsed || which sed)
11
-
12
-DIST=$( date +"%Y-%m-%d" )
13
-
14
-eval "${SED} -E -i 's/(#define +STRING_DISTRIBUTION_DATE) .*$/\1 \"$DIST\"/g' $VERSION_FILE" || exit 1
15
-
16
-git add "$VERSION_FILE" || exit 1
17
-git commit -m "[cron] Bump distribution date ($DIST)"

Loading…
İptal
Kaydet