-
Notifications
You must be signed in to change notification settings - Fork 460
41 lines (40 loc) · 1.64 KB
/
update_lockfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: update lockfile
on:
# Scheduled update (each day)
schedule: [{ cron: "30 01 * * *" }]
jobs:
update-lockfile:
if: github.repository_owner == 'ayamir'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to count the commits
- uses: andstor/file-existence-action@v3
id: check_lockfile
with:
files: "lazy-lock.json"
- name: Run count-new-commits
run: |
echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' --perl-regexp --author='^((?!github-actions).*)$' | wc -l)" >> "$GITHUB_ENV"
- uses: rhysd/action-setup-vim@v1
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
with:
neovim: true
- name: Run lockfile-autoupdate
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
timeout-minutes: 5
run: |
./scripts/install.sh
nvim --headless "+Lazy! update" +qa
cp -pv "${HOME}/.config/nvim/lazy-lock.json" .
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ steps.check_lockfile.outputs.files_exists == 'true' && env.NEW_COMMIT_COUNT > 0 }}
with:
commit_message: "chore(lockfile): auto update lazy-lock.json"
commit_user_name: "github-actions[bot]"
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
file_pattern: "lazy-lock.json"