summaryrefslogtreecommitdiffstats
path: root/.github/workflows/run-autogen.yml
blob: 4790b1617df7b686b88f97cf7730cce1b4a68d68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Run autogen script

on:
    schedule:
        - cron: "0 0 * * *"

jobs:
    run-autogen-script:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
              with:
                  fetch-depth: 0

            - uses: rhysd/action-setup-vim@v1
              with:
                  neovim: true
                  version: v0.6.0

            - name: Clone dependencies
              run: |
                  mkdir -p ~/.local/share/nvim/site/pack/packer/start
                  git clone --depth 1 https://github.com/neovim/nvim-lspconfig ~/.local/share/nvim/site/pack/packer/start/nvim-lspconfig
                  git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/packer/start/plenary.nvim

            - name: Run autogen_metadata.sh script
              run: ./scripts/autogen_metadata.sh

            - uses: dorny/paths-filter@v2
              id: changes
              with:
                  filters: |
                      generated:
                        - 'lua/nvim-lsp-installer/_generated/**'

            - name: Commit and push changes
              if: steps.changes.outputs.generated == 'true'
              run: |
                  git config --local user.email "william@redwill.se"
                  git config --local user.name "William Boman (automated)"
                  git commit -m "run autogen_metadata.lua" -- lua/nvim-lsp-installer/_generated

            - name: Push changes
              if: steps.changes.outputs.generated == 'true'
              uses: ad-m/github-push-action@master
              with:
                  github_token: ${{ secrets.GITHUB_TOKEN }}
                  branch: ${{ github.ref }}