-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(plugin): Using GitHub Action update plugin packages every Monday
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |