Fix daily date bump action

This commit is contained in:
Scott Lahteine 2020-01-04 17:47:48 -06:00
parent 07509febcd
commit 57e37b6c24
2 changed files with 11 additions and 19 deletions

View file

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

View file

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