neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

vim_patches.yml (1897B)


      1 name: vim-patches
      2 on:
      3  schedule:
      4    - cron: '3 3 * * *'
      5  workflow_dispatch:
      6 
      7 jobs:
      8  update-vim-patches:
      9    runs-on: ubuntu-latest
     10    permissions:
     11      contents: write
     12      pull-requests: write
     13    env:
     14      VIM_SOURCE_DIR: ${{ github.workspace }}/vim-src
     15      VERSION_BRANCH: marvim/ci-version-update
     16      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     17    steps:
     18      - uses: actions/checkout@v6
     19        with:
     20          fetch-depth: 0
     21 
     22      - uses: actions/checkout@v6
     23        with:
     24          repository: vim/vim
     25          path: ${{ env.VIM_SOURCE_DIR }}
     26          fetch-depth: 0
     27 
     28      - run: sudo apt-get install libfuse2
     29 
     30      - run: |
     31          gh release download -R neovim/neovim -p nvim-linux-x86_64.appimage
     32          chmod a+x nvim-linux-x86_64.appimage
     33          mkdir -p $HOME/.local/bin
     34          mv nvim-linux-x86_64.appimage $HOME/.local/bin/nvim
     35          printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
     36 
     37      - name: Set up git config
     38        run: |
     39          git config --global user.name 'marvim'
     40          git config --global user.email 'marvim@users.noreply.github.com'
     41 
     42      - name: Update src/version.c
     43        id: update-version
     44        run: |
     45          git checkout -b ${VERSION_BRANCH}
     46          nvim -l scripts/vimpatch.lua
     47          printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
     48 
     49      - name: Automatic PR
     50        if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
     51        run: |
     52          git add -u
     53          TMP_FILE=$(mktemp)
     54          printf 'docs: update version.c\n\n' > ${TMP_FILE}
     55          bash scripts/vim-patch.sh -n >> ${TMP_FILE}
     56          git commit -F ${TMP_FILE}
     57          git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
     58          gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true