Skip to content

Commit 00310e5

Browse files
authored
Merge pull request #7 from dabreadman/dabreadman-spawn-log-toggle
Add toggle to log spawn
2 parents 0c2cdfb + 4c832a9 commit 00310e5

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ env:
3232
MERGE_ARGS: ""
3333
# Optional push arguments
3434
PUSH_ARGS: ""
35+
# Optional toggle to spawn time logs (keeps action active)
36+
SPAWN_LOGS: "false" # "true" or "false"
3537

3638
# This runs every day on 1801 UTC
3739
on:

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
description: Git push arguments
3030
required: false
3131
default: ""
32+
spawn_logs:
33+
description: Toggle to spawn `sync-upstream-repo` with time logs
34+
required: true
35+
default: false
3236

3337
runs:
3438
using: "docker"
@@ -41,6 +45,7 @@ runs:
4145
- ${{ inputs.fetch_args }}
4246
- ${{ inputs.merge_args }}
4347
- ${{ inputs.push_args }}
48+
- ${{ inputs.spawn_logs }}
4449

4550
branding:
4651
icon: "git-merge"

entrypoint.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ GITHUB_TOKEN=$4
99
FETCH_ARGS=$5
1010
MERGE_ARGS=$6
1111
PUSH_ARGS=$7
12+
SPAWN_LOGS=$8
1213

1314
if [[ -z "$UPSTREAM_REPO" ]]; then
1415
echo "Missing \$UPSTREAM_REPO"
@@ -42,10 +43,15 @@ git remote -v
4243

4344
git checkout ${DOWNSTREAM_BRANCH}
4445

45-
echo -n "sync-upstream-repo https://github.com/dabreadman/sync-upstream-repo keeping CI alive. UNIX Time: " >> sync-upstream-repo
46-
date +"%s" >> sync-upstream-repo
47-
git add sync-upstream-repo
48-
git commit sync-upstream-repo -m "Syncing upstream"
46+
case ${SPAWN_LOGS} in
47+
(true) echo -n "sync-upstream-repo https://github.com/dabreadman/sync-upstream-repo keeping CI alive."\
48+
"UNIX Time: " >> sync-upstream-repo
49+
date +"%s" >> sync-upstream-repo
50+
git add sync-upstream-repo
51+
git commit sync-upstream-repo -m "Syncing upstream"
52+
(false) echo "Not spawning time logs"
53+
esac
54+
4955
git push origin
5056

5157
MERGE_RESULT=$(git merge ${MERGE_ARGS} upstream/${UPSTREAM_BRANCH})

0 commit comments

Comments
 (0)