Use latest external workflow.

This commit is contained in:
Kevin Deldycke 2022-03-30 18:05:27 +04:00
parent f907e43ecd
commit 55eebfb5cb
No known key found for this signature in database
GPG Key ID: C572BB01B1ED5A3A
7 changed files with 11 additions and 164 deletions

View File

@ -1,29 +0,0 @@
# See example at:
# https://github.com/avto-dev/markdown-lint/blob/master/lint/config
# /changelog.yml
---
# Line length
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013
# XXX Temporary disabled because of line continuation edge-case. See:
# https://github.com/DavidAnson/markdownlint/issues/302
MD013: false
# Inline HTML
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md033
# is allowed for beautiful rendering on GitHub.
MD033:
# Whitelist elements used to render centered images and footnotes on GitHub.
allowed_elements:
- 'a'
- 'br'
- 'i'
- 'img'
- 'p'
- 'strong'
- 'sup'
# First line in file should be a top level heading
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md041
# Our header image is replacing the title.
MD041: false

View File

@ -2,88 +2,12 @@
name: Autofix
"on":
push:
# Only targets default branch to avoid amplification effects of
# auto-fixing the exact same stuff in multiple non-rebased branches.
# Only targets main branch to avoid amplification effects of auto-fixing
# the exact same stuff in multiple non-rebased branches.
branches:
- 'main'
schedule:
# Run linter every week to catch regressions from external dependencies.
- cron: 17 9 * * 1
- main
jobs:
markdown:
name: Format markdown, update TOC and create a PR
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install doctoc
run: |
sudo npm install -g doctoc
- name: Generate full TOC
run: |
doctoc --github readme.md
- name: Remove forbidden special TOC entries
# See: https://github.com/sindresorhus/awesome-lint/blob/v0.16.0/rules
# /toc.js#L15-L18
run: >
gawk -i inplace '!/^- \[(Contributing|Footnotes)\]\(#.+\)$/{print}'
./readme.md
- name: Install Pandoc
run: |
sudo apt install pandoc
- name: Auto-format to GitHub-Flavored Markdown
run: >
pandoc ./readme.md --from=gfm --to=gfm --output=./readme.md
--columns=79 --wrap=none --tab-stop=2
- name: Auto-fix Markdown
uses: avto-dev/markdown-lint@v1.5.0
# Non-fixable markdown issues will return non-zero error code. Allow
# that step to fail so we can proceed with creating the auto-fix PR
# below.
continue-on-error: true
with:
config: '.github/markdown-lint.yaml'
args: './**/*.md'
fix: true
- uses: peter-evans/create-pull-request@v3.12.0
with:
author: "Kevin Deldycke <kevin@deldycke.com>"
commit-message: "[autofix] Format Markdown"
title: "[autofix] Format Markdown"
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/${{ github.base_ref }}/.github/workflows/autofix.yaml).
labels: "CI/CD"
assignees: kdeldycke
branch: format-markdown
json:
name: Format JSON files and create a PR
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install linter
run: |
sudo npm install jsonlint -g
- name: Lint
run: >
find ./ -type f -name '*.json' -print -exec
jsonlint --in-place "{}" \;
- uses: peter-evans/create-pull-request@v3.12.0
with:
author: "Kevin Deldycke <kevin@deldycke.com>"
commit-message: "[autofix] Format JSON content"
title: "[autofix] Format JSON content"
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/${{ github.base_ref }}/.github/workflows/autofix.yaml).
labels: "CI/CD"
assignees: kdeldycke
branch: format-json
autofix:
uses: kdeldycke/workflows/.github/workflows/autofix.yaml@v1.0.0

View File

@ -8,4 +8,4 @@ name: Autolock
jobs:
autolock:
uses: kdeldycke/workflows/.github/workflows/autolock.yaml@v0.9.1
uses: kdeldycke/workflows/.github/workflows/autolock.yaml@v1.0.0

View File

@ -11,4 +11,4 @@ name: Label sponsors
jobs:
label-sponsors:
uses: kdeldycke/workflows/.github/workflows/label-sponsors.yaml@v0.9.1
uses: kdeldycke/workflows/.github/workflows/label-sponsors.yaml@v1.0.0

View File

@ -8,7 +8,7 @@ name: Labels
jobs:
labels:
uses: kdeldycke/workflows/.github/workflows/labels.yaml@v0.9.1
uses: kdeldycke/workflows/.github/workflows/labels.yaml@v1.0.0
with:
extra-label-files: |
.github/labels-extra.json

View File

@ -6,26 +6,4 @@ name: Lint
jobs:
lint:
uses: kdeldycke/workflows/.github/workflows/lint.yaml@v0.9.1
lint-markdown:
name: Lint markdown
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: avto-dev/markdown-lint@v1.5.0
with:
config: '.github/markdown-lint.yaml'
args: './**/*.md'
lint-awesome:
name: Lint Awesome list
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
# Fetch all history to please linter's age checks.
fetch-depth: 0
- run: |
npx awesome-lint --version
npx awesome-lint
uses: kdeldycke/workflows/.github/workflows/lint.yaml@v1.0.0

View File

@ -15,39 +15,13 @@
A *falsehood* is an ***idea* that you initially believe was true**, but in-reality it is **proven to be false**.
E.g. of an *idea*: valid email address exactly has one `@` character. So, you will use this rule to implement your email-field validation logic. Right? Wrong\! The *reality* is: emails can have multiple `@` chars. Therefore your implementation should allow this. The initial *idea* is a falsehood you believed in.
E.g. of an *idea*: valid email address exactly has one `@` character. So, you will use this rule to implement your email-field validation logic. Right? Wrong! The *reality* is: emails can have multiple `@` chars. Therefore your implementation should allow this. The initial *idea* is a falsehood you believed in.
The *falsehood* articles listed below will have a comprehensive list of those false-beliefs that you should be aware of, to help you become a better programmer.
## Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Meta](#meta)
- [Arts](#arts)
- [Business](#business)
- [Dates and Time](#dates-and-time)
- [Education](#education)
- [Emails](#emails)
- [Geography](#geography)
- [Human Identity](#human-identity)
- [Internationalization](#internationalization)
- [Management](#management)
- [Multimedia](#multimedia)
- [Networks](#networks)
- [Phone Numbers](#phone-numbers)
- [Postal Addresses](#postal-addresses)
- [Science](#science)
- [Society](#society)
- [Software Engineering](#software-engineering)
- [Typography](#typography)
- [Video Games](#video-games)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- mdformat-toc start --slug=github -->
## Meta