Skip to content

Commit 32c6a72

Browse files
authored
chore(ci): add pre-commit workflow (#2)
* chore(ci): add pre-commit workflow * chore: add meta files
1 parent c5ae01f commit 32c6a72

5 files changed

Lines changed: 52 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ on:
66
push:
77
branches:
88
- main
9-
paths:
9+
paths: &ci_paths
1010
- "docker-bake.hcl"
1111
- "**/Dockerfile*"
1212
- ".github/workflows/ci.yaml"
1313
pull_request:
1414
types: [opened, synchronize, reopened]
15+
paths: *ci_paths
1516

1617
concurrency:
1718
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/pre-commit.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: pre-commit
3+
4+
permissions:
5+
id-token: write
6+
contents: write
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- "main"
13+
pull_request:
14+
branches:
15+
- "main"
16+
17+
jobs:
18+
pre-commit:
19+
uses: devops-roast/github-actions/.github/workflows/pre-commit.yaml@main
20+
with:
21+
auto_commit: true
22+
secrets: inherit

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-added-large-files
6+
- id: check-merge-conflict
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
args: [--markdown-linebreak-ext=md]
10+
- id: check-merge-conflict
11+
- id: check-executables-have-shebangs
12+
- id: check-case-conflict
13+
- id: mixed-line-ending
14+
15+
- repo: https://github.com/igorshubovych/markdownlint-cli
16+
rev: v0.45.0
17+
hooks:
18+
- id: markdownlint
19+
20+
- repo: https://github.com/executablebooks/mdformat
21+
rev: 0.7.22
22+
hooks:
23+
- id: mdformat
24+
additional_dependencies:
25+
- mdformat-toc

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# containers
2+
23
A collection of well-maintained container images

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
"pre-commit" = "4.1.0"

0 commit comments

Comments
 (0)