From 27ddf58b264739935ac94b4b5d9569c6364c0e03 Mon Sep 17 00:00:00 2001 From: Mateusz Sadowski Date: Sun, 5 Nov 2023 14:12:36 +0100 Subject: [PATCH] Add a daily prune event --- .github/workflows/daily_prune.yaml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/daily_prune.yaml diff --git a/.github/workflows/daily_prune.yaml b/.github/workflows/daily_prune.yaml new file mode 100644 index 0000000..91a71e7 --- /dev/null +++ b/.github/workflows/daily_prune.yaml @@ -0,0 +1,39 @@ +name: Daily Prune + +on: + schedule: + - cron: '0 0 * * *' # Executes the script every day at 00:00 UTC + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip3 install ruamel.yaml + + - name: Run Python script + run: python scripts/clean_events.py + + - name: Commit changes + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git diff-index --quiet HEAD || (git commit -a -m "Update event files") + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }}