aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/misspell-fixer.yml
blob: daca2637ea711b4a4b727404cc1b0b6f6df793d1 (about) (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: Misspell fixer
on:
  schedule:
    - cron: '0 0 15 * *'
jobs:
  build:
    if: github.repository == 'inspircd/inspircd'
    runs-on: ubuntu-latest
    env:
      REF_BRANCH: ${{ github.ref }}
    steps:
    - uses: actions/checkout@v4
    - name : Set a couple env variables
      run: |
        echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
        echo "REF_BRANCH=${REF_BRANCH//refs\/heads\//}" >> $GITHUB_ENV
    # The below creates a file used by grep '-f'
    # These are compared to './folder/file:line_num:word'
    - name: Whitelist some directories, files, and words.
      run: |
        echo "\
        ^./.github/workflows
        ^./.mailmap
        ^./vendor
        ^./make/directive.pm:.*:atleast
        ALLTIME$
        alltime$
        Alltime$
        setts$" > \
        ${{ runner.workspace }}/inspircd/.misspell-fixer.ignore
    - uses: sobolevn/misspell-fixer-action@master
      with:
        options: '-rvnfuRVD .'
    - uses: peter-evans/create-pull-request@v7
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        branch: ${{ env.REF_BRANCH }}+fix-spellings-${{ env.DATE }}
        author: 'InspIRCd Robot <noreply@inspircd.org>'
        committer: 'InspIRCd Robot <noreply@inspircd.org>'
        commit-message: 'Fixes by misspell-fixer'
        title: 'Typos fix by misspell-fixer'
        reviewers: 'genius3000'