From 720a88a0311101f6292d33cd9993a415aa5ad007 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Mon, 13 Jan 2025 09:04:54 +0000 Subject: [PATCH] Generate changes once a week so github actions keep running. --- .github/workflows/keep_active.yml | 34 +++++++++++++++++++++++++++++++ DUMMY.txt | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/keep_active.yml create mode 100644 DUMMY.txt diff --git a/.github/workflows/keep_active.yml b/.github/workflows/keep_active.yml new file mode 100644 index 0000000..27373ce --- /dev/null +++ b/.github/workflows/keep_active.yml @@ -0,0 +1,34 @@ +name: Keep Repository Active + +on: + schedule: + # Runs at 00:00 UTC every Monday + - cron: '0 0 * * 1' + + # Allow manual trigger for testing + workflow_dispatch: + +jobs: + update-dummy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Modify dummy file + run: | + if grep -q " $" DUMMY.txt; then + # If file ends with space, remove it + sed -i 's/ $//' DUMMY.txt + else + # If file doesn't end with space, add one + echo -n " " >> DUMMY.txt + fi + + - name: Commit and push if changed + run: | + git config --global user.name 'GitHub Action' + git config --global user.email 'action@github.com' + git add DUMMY.txt + git diff --quiet && git diff --staged --quiet || (git commit -m "Update DUMMY.txt to keep repository active" && git push) diff --git a/DUMMY.txt b/DUMMY.txt new file mode 100644 index 0000000..055ed15 --- /dev/null +++ b/DUMMY.txt @@ -0,0 +1 @@ +This is a dummy file to keep the repository active.