aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/update-readme.yml
blob: de416a8733f3d52e0983d723e17d7f0d8b2de408 (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
name: Update README

on:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  update-readme:
    name: Update README
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/create-github-app-token@v2
        id: app-token
        with:
          app-id: ${{ vars.TOKEN_ID }}
          private-key: ${{ secrets.TOKEN_PRIVATE_KEY }}

      - name: Prepare
        env:
          NVIM_TAG: stable
        run: |
          bash ./scripts/ci-install.sh

      - name: Check README
        run: |
          nvim -l scripts/update-readme.lua || echo 'Needs update'

      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v7
        with:
          token: ${{ steps.app-token.outputs.token }}
          sign-commits: true
          commit-message: "bot(readme): update"
          title: Update README
          body: "[beep boop](https://github.com/peter-evans/create-pull-request)"
          branch: update-readme-pr
          base: ${{ github.head_ref }}

      - name: Enable Pull Request Automerge
        env:
          GH_TOKEN: ${{ steps.app-token.outputs.token }}
        run: gh pr merge --rebase --auto update-readme-pr