Skip to content

Commit b8d1227

Browse files
committed
keepalive: avoid diverging commits in forks
In forks of `gitgitgadget-workflows`, we want to prefer merging the upstream branch over generating keepalive commits that diverge from upstream. To that end, run the workflow every week, and ensure that there is a commit at least every 4 weeks in forks, but every 3 weeks in the upstream repository. That way, the forks should always pick up the upstream's keepalive commit. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 83e1439 commit b8d1227

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/keepalive.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Keep scheduled workflows alive
22

33
on:
44
schedule:
5-
- cron: "23 19 3,17 * *" # 7:23pm on every 3rd and 17th of the month
5+
- cron: "23 19 * * 0" # 7:23pm on every Sunday
66
workflow_dispatch:
77

88
env:
@@ -34,7 +34,7 @@ jobs:
3434
if: steps.merge.outputs.result != 'merged'
3535
run: |
3636
if test workflow_dispatch != '${{ github.event_name }}' &&
37-
test 0 -lt $(git rev-list --count --since=3.weeks.ago HEAD)
37+
test 0 -lt $(git rev-list --count --since=${{ github.event.repository.fork == true && '4' || '3' }}.weeks.ago HEAD)
3838
then
3939
echo "::notice::No need to keep alive, there were commits in the last three weeks"
4040
echo "result=skip-push" >>$GITHUB_OUTPUT

0 commit comments

Comments
 (0)