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