From 4951253d52322ba7380c3f1269ed2465e443ce2e Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Sat, 9 Dec 2023 13:16:49 +0100 Subject: [PATCH] Reworked the maintance action to use a PAT --- .gitea/workflows/maintenance.yaml | 19 ++++++++++++++----- .gitignore | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitea/workflows/maintenance.yaml b/.gitea/workflows/maintenance.yaml index 3783bb9..35e229f 100644 --- a/.gitea/workflows/maintenance.yaml +++ b/.gitea/workflows/maintenance.yaml @@ -5,15 +5,26 @@ on: paths: - .gitea/workflows/maintenance.yaml schedule: - - cron: 0 1 * * 0 + - cron: '@weekly' workflow_dispatch: jobs: auto-update: name: pre-commit Autoupdate runs-on: pi64 + env: + SPECIFIC_BRANCH: chore/update-pre-commit steps: - uses: actions/checkout@v4 + with: + ref: main + token: ${{ secrets.REPO_TOKEN }} + - name: Attempt to checkout specific branch + uses: actions/checkout@v4 + with: + ref: ${{ env.SPECIFIC_BRANCH }} + token: ${{ secrets.REPO_TOKEN }} + continue-on-error: true - uses: actions/setup-python@v4 - run: pip install pre-commit shell: bash @@ -26,18 +37,16 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: 'chore: update pre-commit hooks' - branch: update/pre-commit-hooks - push_options: --force + branch: ${{ env.SPECIFIC_BRANCH }} create_branch: true - name: Generate Date run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - run: echo "${{steps.auto-commit-action.outputs.changes_detected}}" - 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: update/pre-commit-hooks + branch: ${{ env.SPECIFIC_BRANCH }} title: Updates to the pre-commit action created at ${{ env.CURRENT_DATE }} body: Update to the pre-commit action. assignees: Philipp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..56c28a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules/.cache -- 2.47.2