2020-08-03 08:39:28 -04:00
|
|
|
name: Autofix
|
|
|
|
on:
|
|
|
|
push:
|
2020-09-01 11:30:04 -04:00
|
|
|
# Only targets default branch to avoid amplification effects of
|
2020-08-03 08:39:28 -04:00
|
|
|
# auto-fixing the exact same stuff in multiple non-rebased branches.
|
|
|
|
branches:
|
2020-09-01 11:30:04 -04:00
|
|
|
- 'main'
|
2020-08-03 08:39:28 -04:00
|
|
|
schedule:
|
|
|
|
# Run linter every week to catch regressions from external dependencies.
|
|
|
|
- cron: 17 9 * * 1
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
toc:
|
|
|
|
name: Generator TOC and auto-commit
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install doctoc
|
|
|
|
run: |
|
|
|
|
sudo npm install -g doctoc
|
2020-08-10 01:56:20 -04:00
|
|
|
- uses: actions/checkout@v2.3.2
|
2020-08-03 08:39:28 -04:00
|
|
|
- name: Generate full TOC
|
|
|
|
run: |
|
|
|
|
# Generates title as part of the TOC to avoid extra non-conform blank
|
|
|
|
# lines. See:
|
|
|
|
# https://github.com/thlorenz/doctoc/issues/101
|
|
|
|
# https://github.com/thlorenz/doctoc/pull/145
|
|
|
|
doctoc --github --title "## Contents" readme.md
|
|
|
|
- name: Remove blacklisted TOC entries
|
|
|
|
# See: https://github.com/sindresorhus/awesome-lint/blob/v0.13.0/rules/toc.js#L15-L20
|
|
|
|
run: |
|
2020-09-01 10:40:17 -04:00
|
|
|
gawk -i inplace '!/^- \[(Contribute|Contributing|Licence|License|Footnotes)\]\(#.+\)$/{print}' ./readme.md
|
2020-08-03 08:39:28 -04:00
|
|
|
- name: Commit and push changes
|
2020-09-14 02:01:06 -04:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4.5.1
|
2020-08-03 08:39:28 -04:00
|
|
|
with:
|
|
|
|
commit_author: "Kevin Deldycke <kevin@deldycke.com>"
|
|
|
|
commit_message: "[lint] Update TOC."
|
|
|
|
file_pattern: readme.md
|
2020-08-03 08:41:57 -04:00
|
|
|
|
|
|
|
typos:
|
|
|
|
name: Fix typos and create a PR
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-08-10 01:56:20 -04:00
|
|
|
- uses: actions/checkout@v2.3.2
|
2020-08-03 08:41:57 -04:00
|
|
|
- uses: sobolevn/misspell-fixer-action@0.1.0
|
|
|
|
- uses: peter-evans/create-pull-request@v3
|
|
|
|
with:
|
|
|
|
author: "Kevin Deldycke <kevin@deldycke.com>"
|
|
|
|
commit-message: "Fix typo."
|
|
|
|
title: "Typo"
|
|
|
|
body: >
|
|
|
|
[Auto-generated on run #${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
|
|
as defined by [workflow action](https://github.com/${{ github.repository }}/blob/develop/.github/workflows/autofix.yaml).
|
|
|
|
labels: "typo"
|
|
|
|
assignees: kdeldycke
|
|
|
|
branch: fix-typo
|