Philipp Horstenkamp db81df0265
Some checks failed
Auto Maintenance Cycle / pre-commit Autoupdate (push) Failing after 1m45s
Reworked the maintenance action to use an ssh key.
2024-05-21 00:23:58 +02:00

50 lines
1.5 KiB
YAML

name: Auto Maintenance Cycle
on:
push:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
auto-update:
name: pre-commit Autoupdate
runs-on: pi64
env:
SPECIFIC_BRANCH: chore/update-pre-commit
steps:
- run: echo "Actor ${{ github.actor }}"
- name: check is SSH_RUNNER exists
env:
SSH_RUNNER: ${{ secrets.SSH_RUNNER }}
if: ${{ env.SSH_RUNNER == '' }}
run: echo the secret "SSH_RUNNER" has not been made; echo please go to
- uses: actions/checkout@v4
with:
ref: main
ssh-key: ${{ secrets.SSH_RUNNER }}
- uses: actions/setup-python@v4
- run: pip install pre-commit
shell: bash
- run: pre-commit autoupdate
shell: bash
- name: Test pre-commit
run: SKIP=no-commit-to-branch pre-commit run -a
- name: Commit
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: update pre-commit hooks'
branch: ${{ env.SPECIFIC_BRANCH }}
create_branch: true
- name: Generate Date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create an PR action
if: steps.auto-commit-action.outputs.changes_detected == 'true'
uses: https://git.horstenkamp.eu/Philipp/gitea-act-create-pr@main
with:
token: ${{ secrets.REPO_TOKEN }}
branch: ${{ env.SPECIFIC_BRANCH }}
title: Updates to the pre-commit action created at ${{ env.CURRENT_DATE }}
body: Update to the pre-commit action.