Skip to content

Commit

Permalink
ci(plugin): Using GitHub Action update plugin packages every Monday
Browse files Browse the repository at this point in the history
  • Loading branch information
kang8 committed Dec 23, 2023
1 parent 5a21562 commit b3356df
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/update_lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: update lockfile
on: [push, pull_request]

jobs:
update-lockfile:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: rhysd/action-setup-vim@v1
with:
neovim: true

- name: Run lockfile-autoupdate
timeout-minutes: 5
run: |
git clone https://github.com/kang8/nvim.git ~/.config/nvim
nvim --headless "+Lazy! update" +qa
cp -pv "${HOME}/.config/nvim/lazy-lock.json" .
- name: Commit and Create Pull Request
run: |
if [[ -n $(git status --porcelain) ]]; then
# Commit
git config push.autoSetupRemote true
git config user.name github-actions
git config user.email [email protected]
git checkout -b chore/update-lockfile--$RANDOM
git commit --all --message="chore(lockfile): auto update lazy-lock.json"
git push
# Create pull request
gh pr create --base master --title 'Auto update lazy-lock.json' --body 'Created by Github Action'
else
echo "Not plugin update."
fi

0 comments on commit b3356df

Please sign in to comment.