Skip to content

Commit

Permalink
Add lychee
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Jun 4, 2022
1 parent 1254b87 commit 2e5ebd8
Show file tree
Hide file tree
Showing 14 changed files with 161 additions and 176 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/ansible-lint.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Links

on:
workflow_dispatch:
push:
branches-ignore:
- main
paths:
- .github/workflows/links.yml
- "**.md"
schedule:
- cron: "0 3 * * 1"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Link Checker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: lycheeverse/[email protected]
with:
args: --no-progress --exclude-path CHANGELOG.md --exclude-all-private --exclude 'GITHUB_SHA%7D|_VERSION%7D|_TYPE%7D' -- './**/*.md'
fail: true
6 changes: 4 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ name: Lint Code Base
# Start the job on all push #
#############################
on:
workflow_dispatch:
push:
branches-ignore:
- main
Expand Down Expand Up @@ -45,8 +46,9 @@ jobs:
- name: Lint Code Base
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
FILTER_REGEX_EXCLUDE: "(CHANGELOG.md)"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ERROR_ON_MISSING_EXEC_BIT: true
LINTER_RULES_PATH: .
VALIDATE_ALL_CODEBASE: false
VALIDATE_ANSIBLE: false
VALIDATE_JSCPD: false
FILTER_REGEX_INCLUDE: .*(\.sh|\.json|\.github|http|tools|docs).*
29 changes: 29 additions & 0 deletions .github/workflows/markdown-mdspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: markdown-mdspell

on:
push:
branches-ignore:
- main
paths:
- '**.md'
- .github/workflows/markdown-mdspell.yml
- .spelling

jobs:
markdown-mdspell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install markdown-spellcheck
run: npm install -g markdown-spellcheck

- name: Run mdspell
run: |
set -euxo pipefail
find . -type f \( -name "*.md" ! -name "CHANGELOG.md" \) -print0 | xargs -0 --max-args=1 mdspell --ignore-numbers --ignore-acronyms --report --en-gb {} \;
51 changes: 0 additions & 51 deletions .github/workflows/markdown.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: MegaLinter

on:
workflow_dispatch:
push:
branches-ignore:
- main

env:
APPLY_FIXES: all
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_MODE: commit

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
name: MegaLinter
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: MegaLinter
id: ml
uses: megalinter/megalinter@v5
env:
DISABLE_LINTERS: COPYPASTE_JSCPD,MARKDOWN_MARKDOWN_LINK_CHECK,SPELL_CSPELL,YAML_V8R
FILTER_REGEX_EXCLUDE: '(.*\.ps1)'
FORMATTERS_DISABLE_ERRORS: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PRINT_ALPACA: false
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes"
labels: bot

- name: Create PR output
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: Prepare commit
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
run: sudo chown -Rc $UID .git/

- name: Commit and push applied linter fixes
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "[MegaLinter] Apply linters fixes"
22 changes: 0 additions & 22 deletions .github/workflows/periodic-markdown-links-check.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/shellcheck.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/yamllint.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .mlc_config.json

This file was deleted.

Loading

0 comments on commit 2e5ebd8

Please sign in to comment.