aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/autogenerate.yml
blob: b1485134033125f6c1099de573f0706dcfb3874d (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
name: Autogenerate code

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

jobs:
    autogenerate:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - uses: rhysd/action-setup-vim@v1
              with:
                  neovim: true
                  version: v0.7.0

            - name: make generate
              run: make generate

            - name: Create Pull Request
              id: cpr
              uses: peter-evans/create-pull-request@v4
              with:
                  token: ${{ secrets.PAT }}
                  author: "William Botman <william+bot@redwill.se>"
                  committer: "William Botman <william+bot@redwill.se>"
                  add-paths: lua/mason-lspconfig
                  commit-message: "chore: update generated code"
                  branch: chore/generate
                  branch-suffix: short-commit-hash
                  delete-branch: true
                  labels: automerge
                  title: "chore: update generated code"

            - name: Enable Pull Request Automerge
              if: steps.cpr.outputs.pull-request-operation == 'created'
              uses: peter-evans/enable-pull-request-automerge@v2
              with:
                  token: ${{ secrets.PAT }}
                  pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
                  merge-method: squash