Skip to content

Commit b3b6f28

Browse files
committed
chore: Add keep alive workflow
1 parent 3c26d22 commit b3b6f28

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,3 @@ jobs:
6060
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
6161
with:
6262
sarif_file: 'trivy-results.sarif'
63-
64-
keepalive-job:
65-
name: Keep repository alive to prevent workflows to be disabled
66-
if: ${{ always() }}
67-
needs: build_push_check
68-
permissions:
69-
actions: write # for gautamkrishnar/keepalive-workflow to keep the workflow alive
70-
runs-on: ubuntu-latest
71-
steps:
72-
- name: Checkout repository
73-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
74-
- name: Keep workflow alive
75-
uses: gautamkrishnar/keepalive-workflow@2a8ae70f39b79fb50659d17ccc6f372f461813b2 # v2.0.10

.github/workflows/keep-alive.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Keep Workflow Alive
2+
description: |
3+
This workflow is designed to keep the repository alive by making a dummy commit
4+
to the `keepalive` branch to make sure the GitHub workflow will continue to run.
5+
It runs on a weekly schedule and can also be triggered manually via the GitHub
6+
Actions UI.
7+
8+
on:
9+
schedule:
10+
- cron: '0 0 * * 0'
11+
workflow_dispatch:
12+
push:
13+
branches:
14+
- bbujon/master
15+
16+
jobs:
17+
keepalive:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Git
24+
run: |
25+
git config --global user.name "github-actions[bot]"
26+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
27+
28+
- name: Make dummy commit to keep workflow alive
29+
run: |
30+
git fetch origin keepalive
31+
git checkout keepalive
32+
echo "Last update from $(date -u)" > keepalive
33+
git add keepalive
34+
git commit -m "chore: keepalive" || echo "No changes to commit"
35+
git push origin keepalive

0 commit comments

Comments
 (0)