Vim Plugins #1255
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
name: Vim Plugins | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
update: | |
name: Update | |
runs-on: ubuntu-latest | |
outputs: | |
changed: ${{ steps.update.outputs.changed }} | |
head: ${{ steps.stage.outputs.head }} | |
steps: | |
- uses: DeterminateSystems/nix-installer-action@v14 | |
with: | |
diagnostic-endpoint: '' | |
source-url: 'https://install.lix.systems/lix/lix-installer-x86_64-linux' | |
- uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.REPO_KEY }} | |
- name: Configure git | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Configure $NIX_PATH | |
run: | | |
echo "NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock).tar.gz" >> $GITHUB_ENV | |
- id: update | |
name: pkgs/vim-plugins/update.py | |
run: | | |
pkgs/vim-plugins/update.py | |
if ! git diff --exit-code --quiet remotes/origin/${{ github.ref_name }}..; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
fi | |
- id: stage | |
name: Stage changes | |
if: steps.update.outputs.changed == 'true' | |
run: | | |
git push -f origin 'HEAD:ci/vim-plugins/${{ github.sha }}' | |
echo 'head=ci/vim-plugins/${{ github.sha }}' >> $GITHUB_OUTPUT | |
check: | |
name: Run Flake Checks | |
needs: [update] | |
if: needs.update.outputs.changed == 'true' | |
uses: ./.github/workflows/checks.yml | |
with: | |
ref_head: ${{ needs.update.outputs.head }} | |
secrets: | |
cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
push: | |
name: Push | |
runs-on: ubuntu-latest | |
needs: [update, check] | |
if: needs.update.outputs.changed == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.REPO_KEY }} | |
fetch-depth: 2 | |
ref: ${{ needs.update.outputs.head }} | |
- name: Configure git | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Push changes | |
run: | | |
git pull --rebase origin '${{ github.ref }}' | |
git push origin 'HEAD:${{ github.ref }}' | |
git push origin -d '${{ needs.update.outputs.head }}' |