Skip to content

ci(plugin): Using GitHub Action update plugin packages every Monday #5

ci(plugin): Using GitHub Action update plugin packages every Monday

ci(plugin): Using GitHub Action update plugin packages every Monday #5

name: update lockfile
on: [push, pull_request]
jobs:
update-lockfile:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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