浏览代码

Fix daily date bump action

Scott Lahteine 4 年前
父节点
当前提交
57e37b6c24
共有 2 个文件被更改,包括 11 次插入19 次删除
  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
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 查看文件

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

正在加载...
取消
保存