Add auto-update workflow
This commit is contained in:
55
.gitea/workflows/auto-update.yaml
Normal file
55
.gitea/workflows/auto-update.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Based on https://github.com/infinilabs/gitea-pr/blob/main/action.yml
|
||||||
|
|
||||||
|
name: Auto update flake.lock
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # allows manual triggering
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-update:
|
||||||
|
runs-on: basic-nix
|
||||||
|
steps:
|
||||||
|
- name: Check out repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set git bot info
|
||||||
|
run: >-
|
||||||
|
git config user.email "noreply@notadev.net" &&
|
||||||
|
git config user.name "Update bot"
|
||||||
|
|
||||||
|
- name: Login to Gitea
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GIT_SERVER_URL: tea.notadev.net
|
||||||
|
GIT_SERVER_TOKEN: ${{ secrets.token }}
|
||||||
|
GIT_SERVER_USER: ${{ secrets.user }}
|
||||||
|
GIT_SERVER_PASSWORD: ${{ secrets.password }}
|
||||||
|
run: >-
|
||||||
|
cd "${{ env.GITHUB_WORKSPACE }}" &&
|
||||||
|
echo "$PWD" &&
|
||||||
|
export XDG_CONFIG_HOME="$PWD" &&
|
||||||
|
tea login add
|
||||||
|
|
||||||
|
- name: Update flake.lock
|
||||||
|
run: nix flake update
|
||||||
|
|
||||||
|
- name: Create new commit
|
||||||
|
run: >-
|
||||||
|
git checkout -b update-lockfile &&
|
||||||
|
git add flake.lock &&
|
||||||
|
git commit -m "Update flake.lock" &&
|
||||||
|
git push origin update-lockfile
|
||||||
|
|
||||||
|
- name: Create PR
|
||||||
|
shell: bash
|
||||||
|
run: >-
|
||||||
|
cd "${{ env.GITHUB_WORKSPACE }}" &&
|
||||||
|
echo "$PWD" &&
|
||||||
|
export XDG_CONFIG_HOME="$PWD" &&
|
||||||
|
tea pr create \
|
||||||
|
--head "update-lockfile" \
|
||||||
|
--base "main" \
|
||||||
|
--title "Update flake.lock" \
|
||||||
|
--yes
|
||||||
Reference in New Issue
Block a user