Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
feat(gha): unify GHA - renovate, megalinter, markdown, and others (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Feb 8, 2024
1 parent ba358e9 commit 45babbd
Show file tree
Hide file tree
Showing 37 changed files with 3,186 additions and 12,631 deletions.
6 changes: 6 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Users referenced in this file will automatically be requested as reviewers for
# PRs that modify the given paths
# See https://help.github.com/articles/about-code-owners/, https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

# All code
* @ruzickap
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
title: 'Bug: This is a sample issue title'
labels: bug
assignees: ruzickap

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behaviour.

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: GitHub Actions Community Forum
url: https://github.com/orgs/community/discussions/
about: Please ask questions about GitHub Actions here.
- name: GitHub Pages help
url: https://help.github.com/en/github/working-with-github-pages
about: GitHub Pages documentation here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Proposal
about: Suggest an idea for this project
title: 'Proposal: This is a sample title'
labels: proposal
assignees: ruzickap

---

**Is your feature request related to a problem? Please describe**
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
10 changes: 0 additions & 10 deletions .github/dependabot.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"config:recommended",
"docker:pinDigests",
"helpers:pinGitHubActionDigestsToSemver",
"security:openssf-scorecard",
":disableDependencyDashboard",
":docker",
":disableRateLimiting",
":enableVulnerabilityAlertsWithLabel(security)",
],
"git-submodules": {
enabled: true,
},
labels: [
"renovate",
"renovate/{{replace '.*/' '' depName}}",
"renovate/{{updateType}}",
],
lockFileMaintenance: {
enabled: true,
schedule: ["before 6am on Sunday"],
},
packageRules: [
{
matchUpdateTypes: ["major"],
automerge: false,
},
{
description: "Ignore frequent renovate updates",
enabled: false,
matchPackageNames: ["renovatebot/github-action"],
matchUpdateTypes: ["patch"],
},
{
description: "Update renovatebot/github-action minor updates on Sundays",
matchPackageNames: ["renovatebot/github-action"],
matchUpdateTypes: ["minor"],
schedule: ["* * * * 0"],
},
],
prBodyTemplate: "{{{table}}}{{{notes}}}{{{changelogs}}}",
rebaseWhen: "behind-base-branch",
regexManagers: [
{
extractVersionTemplate: "{{#if extractVersion}}{{{extractVersion}}}{{else}}^v?(?<version>.+)${{/if}}",
fileMatch: ["\\.ya?ml$", "\\.md$", "^Dockerfile$", "^entrypoint\\.sh$"],
matchStrings: [
'# renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)( versioning=(?<versioning>.+?))?( extractVersion=(?<extractVersion>.+?))?( registryUrl=(?<registryUrl>.+?))?\\s.*[=:]\\s*"?(?<currentValue>.+?)"?\\s',
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
},
],
separateMinorPatch: true,
}
15 changes: 0 additions & 15 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

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

on:
workflow_dispatch:
push:
paths:
- .github/workflows/links.yml
- lychee.toml
schedule:
- cron: "0 0 * * 1"

permissions: read-all

jobs:
links:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Pages
id: pages
uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0

- name: Restore lychee cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Link Checker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: lycheeverse/lychee-action@c053181aa0c3d17606addfe97a9075a32723548a # v1.9.3
with:
args: ". --exclude-path CHANGELOG.md ${{ steps.pages.outputs.base_url }}"
fail: true
53 changes: 0 additions & 53 deletions .github/workflows/linter.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/markdown-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: markdown-check

on:
workflow_dispatch:
push:
branches-ignore:
- main
paths:
- "**.md"
- .github/workflows/markdown-check.yml
- .markdownlint.yml
- .mlc_config.json
- .spelling

permissions: read-all

jobs:
markdownlint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Markdown Lint
uses: ruzickap/action-my-markdown-linter@919d3735df9bbc094d206521a774133ec8f3c4ca # v1.1.0
with:
exclude: |
CHANGELOG.md
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Link Checker
uses: ruzickap/action-my-markdown-link-checker@e7e8635735a15a86b081f8255022bcc251cc9003 # v1.2.0
with:
exclude: |
CHANGELOG.md
markdown-spell-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Node.js LTS version
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1

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

- name: Run mdspell
run: find . -type f \( -name "*.md" ! -name "CHANGELOG.md" \) -print0 | xargs -0 --max-args=1 --verbose mdspell --ignore-numbers --ignore-acronyms --report --en-gb
43 changes: 43 additions & 0 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: mega-linter

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

permissions: read-all

jobs:
mega-linter:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Restore lychee cache
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Extract commands from markdown files
run: |
set -euxo pipefail
echo '#!/usr/bin/env bash' > README.sh
find . -name '*.md' -print0 | while IFS= read -r -d '' FILE; do
# Extract: ```bash ... ```
sed -n "/^\`\`\`\(bash\|shell\)$/,/^\`\`\`$/p" "${FILE}" | sed '/^```*/d' >> README.sh
# Extract: ```bash ... ```
sed -n "/^ \`\`\`\(bash\|shell\)$/,/^ \`\`\`$/p" "${FILE}" | sed '/^ ```*/d; s/^ //' >> README.sh
done
chmod a+x README.sh
- name: 💡 MegaLinter
uses: oxsecurity/megalinter@688bc7466d7ab4faa83d614c2e6f9acf42b674dc # v7.8.0
env:
GITHUB_COMMENT_REPORTER: false
GITHUB_STATUS_REPORTER: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 0 additions & 31 deletions .github/workflows/periodic-broken-link-checks.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: release-please

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@cc61a07e2da466bebbc19b3a7dd01d6aecb20d1e # v4.0.2
with:
release-type: simple
Loading

0 comments on commit 45babbd

Please sign in to comment.