Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: markdown linter ci action and Makefile command #5

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .github/CONTRIBUTING.md
Empty file.
18 changes: 17 additions & 1 deletion .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- name: 📦 Check out the codebase
uses: actions/checkout@v4.1.1

# See: https://github.com/wagoid/commitlint-github-action
- name: 🧐 Lint commits using "commitlint"
uses: wagoid/commitlint-github-action@v6.0.1
with:
Expand All @@ -47,4 +46,21 @@ jobs:
file_or_dir: '.'
strict: true

markdown-linting:
timeout-minutes: 4
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: markdown-linting-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v4.1.1

- name: 🧐 Lint Markdown files
uses: DavidAnson/markdownlint-cli2-action@v16.0.0
with:
globs: |
**/*.md
!CHANGELOG.md

...
6 changes: 6 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.34.0/schema/markdownlint-config-schema.json",
"line-length": false,
"no-inline-html": false,
"first-line-h1": false
}
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@ repos:
stages:
- commit-msg

- repo: local
hooks:
- id: markdownlint
name: markdownlint-cli2
description: Run markdownlint-cli2 on your Markdown files using the docker image
language: docker_image
types: [markdown]
entry: davidanson/markdownlint-cli2-rules:latest

...
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ ACTION_LINT_RUNNER ?= $(DOCKER) run --rm $$(tty -s && echo "-it" || echo) \
rhysd/actionlint:latest \
-color -verbose

MARKDOWN_LINT_RUNNER ?= $(DOCKER) run --rm $$(tty -s && echo "-it" || echo) \
-v $(shell pwd):/app \
--workdir /app \
davidanson/markdownlint-cli2-rules:latest

#
# Self documenting Makefile code
# ------------------------------------------------------------------------------------
Expand Down Expand Up @@ -84,6 +89,14 @@ lint-actions: ## Lint all github actions
@$(ACTION_LINT_RUNNER) | tee -a $(MAKE_LOGFILE)
.PHONY: lint-actions

lint-md: ## Lint all markdown files using markdownlint-cli2
@$(MARKDOWN_LINT_RUNNER) --fix "**/*.md" "!CHANGELOG.md" | tee -a $(MAKE_LOGFILE)
.PHONY: lint-md

lint-md-dry: ## Lint all markdown files using markdownlint-cli2 in dry-run mode
@$(MARKDOWN_LINT_RUNNER) "**/*.md" "!CHANGELOG.md" | tee -a $(MAKE_LOGFILE)
.PHONY: lint-md-dry

#
# Release
# ------------------------------------------------------------------------------------
Expand Down
67 changes: 66 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,66 @@
# .github
<br>

<div align="center">
<a href="https://wayof.dev" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wayofdev/.github/master/assets/logo.gh-dark-mode-only.png">
<img width="400" src="https://raw.githubusercontent.com/wayofdev/.github/master/assets/logo.gh-light-mode-only.png" alt="WayOfDev Logo">
</picture>
</a>
</div>
<br>

<br>

<div align="center">
<a href="https://github.com/wayofdev/.github/actions" target="_blank"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fgh-actions%2Fbadge&style=flat-square"/></a>
<a href="https://github.com/wayofdev/.github" target="_blank"><img alt="Commits since latest release" src="https://img.shields.io/github/commits-since/wayofdev/.github/latest?style=flat-square"></a>
<a href="https://discord.gg/CE3TcCC5vr" target="_blank"><img alt="Codecov" src="https://img.shields.io/discord/1228506758562058391?style=flat-square&logo=discord&labelColor=7289d9&logoColor=white&color=39456d"></a>
<a href="https://x.com/intent/follow?screen_name=wayofdev" target="_blank"><img alt="Follow on Twitter (X)" src="https://img.shields.io/badge/-Follow-black?style=flat-square&logo=X"></a>
</div>

<br>

# Organization Health Files

This repository contains [community health files](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file) for the [@wayofdev](https://github.com/wayofdev) organization.

<br>

## 📦 Changelog

The maintainers of this project record notable changes to this project in a [changelog](./CHANGELOG.md).

<br>

## 🤝 Code of Conduct

We believe in maintaining a respectful environment. All contributors are encouraged to adhere to our [Code of Conduct](./.github/CODE_OF_CONDUCT.md) to ensure a welcoming experience for everyone involved.
lotyp marked this conversation as resolved.
Show resolved Hide resolved

<br>

## ⚖️ License

[![Licence](https://img.shields.io/github/license/wayofdev/gh-actions?style=for-the-badge&color=blue)](./LICENSE)

<br>

## 🙌 Want to Contribute?

Thank you for considering contributing to the wayofdev community! We are open to all kinds of contributions. If you want to:
lotyp marked this conversation as resolved.
Show resolved Hide resolved

- 🤔 Suggest a feature
- 🐛 Report an issue
- 📖 Improve documentation
- 👨‍💻 Contribute to the code

You are more than welcome. Before contributing, kindly check our [contribution guidelines](.github/CONTRIBUTING.md).

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org)

<br>

## 🌐 Social Links

- **X (Twitter):** Follow our organization [@wayofdev](https://x.com/intent/follow?screen_name=wayofdev) and the author [@wlotyp](https://x.com/intent/follow?screen_name=wlotyp).
- **Discord:** Join our community on [Discord](https://discord.gg/CE3TcCC5vr).