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

Commit

Permalink
feat(gha): unify GHA - renovate, megalinter, markdown, and others
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Feb 10, 2024
1 parent 10cd98d commit 45b242d
Show file tree
Hide file tree
Showing 25 changed files with 493 additions and 2,235 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.
81 changes: 43 additions & 38 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,51 +1,56 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"branchPrefix": "renovate/",
"labels": ["renovate", "renovate/{{replace '.*/' '' depName}}", "renovate/{{updateType}}"],
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"automergeType": "branch",
// Do not wait for tests - this will speed up the whole process - updating many branches + running many tests
"ignoreTests": true,
"automerge": true,
},
$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: [
{
"description": "Ignore frequent renovate updates",
"matchPackageNames": ["renovatebot/github-action"],
"matchUpdateTypes": ["patch"],
"enabled": false
matchUpdateTypes: ["major"],
automerge: false,
},
{
"matchPackageNames": ["renovatebot/github-action"],
"matchUpdateTypes": ["minor"],
"automergeType": "branch",
"automerge": true,
"ignoreTests": true,
"schedule": ["* 0,2,4 1-7 * 0"],
description: "Ignore frequent renovate updates",
enabled: false,
matchPackageNames: ["renovatebot/github-action"],
matchUpdateTypes: ["patch"],
},
{
"description": "Update all github-actions by default",
"matchManagers": ["github-actions"],
"automergeType": "branch",
"automerge": true,
description: "Update renovatebot/github-action minor updates on Sundays",
matchPackageNames: ["renovatebot/github-action"],
matchUpdateTypes: ["minor"],
schedule: ["* * * * 0"],
},
],
"prBodyTemplate": "{{{table}}}{{{notes}}}{{{changelogs}}}",
"concurrentRequestLimit": 20,
"rebaseWhen": "behind-base-branch",
"regexManagers": [
prBodyTemplate: "{{{table}}}{{{notes}}}{{{changelogs}}}",
rebaseWhen: "behind-base-branch",
regexManagers: [
{
"fileMatch": [
".*\\.ya?ml$",
".*\\.md$",
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.+?) depName=(?<depName>.+?)( versioning=(?<versioning>.+?))?( extractVersion=(?<extractVersion>.+?))?( registryUrl=(?<registryUrl>.+?))?\\s.*[=:]\\s*\"?(?<currentValue>.+?)\"?\\s",
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}}",
"extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^v?(?<version>.+)${{/if}}",
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
},
],
"separateMinorPatch": true,
separateMinorPatch: true,
}
3 changes: 3 additions & 0 deletions .github/workflows/gh-pages-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ env:
# renovate: datasource=github-tags depName=gohugoio/hugo
HUGO_VERSION: 0.105.0

permissions:
contents: write

jobs:
gh-pages-build:
runs-on: ubuntu-latest
Expand Down
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
42 changes: 0 additions & 42 deletions .github/workflows/lint-pr-title.yml

This file was deleted.

44 changes: 25 additions & 19 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: MegaLinter
---
name: mega-linter

on:
workflow_dispatch:
Expand All @@ -9,29 +10,34 @@ on:
permissions: read-all

jobs:
build:
name: MegaLinter
mega-linter:
runs-on: ubuntu-latest
permissions:
contents: write
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: MegaLinter
uses: megalinter/megalinter@v6.14.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: 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:
BASH_SHFMT_ARGUMENTS: --indent 2 --space-redirects
CSS_STYLELINT_FILTER_REGEX_EXCLUDE: docosaurus-test/src/
DISABLE_LINTERS: MARKDOWN_MARKDOWN_LINK_CHECK,SPELL_CSPELL
FORMATTERS_DISABLE_ERRORS: false
GITHUB_COMMENT_REPORTER: false
GITHUB_STATUS_REPORTER: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HTML_HTMLHINT_FILTER_REGEX_EXCLUDE: /index.html
JAVASCRIPT_STANDARD_FILTER_REGEX_EXCLUDE: docosaurus-test/
MARKDOWN_MARKDOWNLINT_CONFIG_FILE: .markdownlint.yml
PRINT_ALPACA: false
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
YAML_V8R_FILTER_REGEX_EXCLUDE: (^jekyll-chirpy/_config.yml)
33 changes: 0 additions & 33 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 45b242d

Please sign in to comment.