Skip to content

Commit

Permalink
DOC/MEDIUM: ci: add aspell to commit check job
Browse files Browse the repository at this point in the history
  • Loading branch information
oktalz authored and mjuraga committed Oct 10, 2024
1 parent e8451ff commit fd5b18d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .aspell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
mode: commit
min_length: 3
allowed:
- aspell
- repo
- yaml
- config
- Github
- Gitlab
- env
- failsafe
- golang
- mkdir
- WORKDIR
- apk
- ENTRYPOINT
- ubuntu
- golangci
- sudo
- releaser
- backend
- backends
- frontend
- frontends
- tcp
- crd
- linter
- linters
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Commit subject
name: HAProxy check commit message
on:
pull_request:
branches:
Expand All @@ -7,7 +7,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- name: check-commit
uses: docker://haproxytech/check-commit:v2.1.0
- name: commit-policy
uses: docker://ghcr.io/haproxytech/commit-check:5.0.4
env:
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cmd/dataplaneapi/*
.vscode/
.test/
bin/golangci-lint
bin/check-commit

# ignore Goland ide config
.idea
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ gofumpt:
script:
- make gofumpt
- test -z "$(git diff 2> /dev/null)" || exit 'Go code not formatted, issue \`make gofumpt\` and commit the result'
lint-commit-msg:
commit-policy:
stage: lint
image:
name: $CI_REGISTRY_GO/check-commit:v2.1.0
name: $CI_REGISTRY_GO/commit-check:5.0.4
entrypoint: [""]
tags:
- go
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SWAGGER_VERSION=${shell curl -s https://raw.githubusercontent.com/haproxytech/cl
BUILD_DATE=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
CGO_ENABLED?=0
GOLANGCI_LINT_VERSION=1.57.1
CHECK_COMMIT=5.0.4

all: update clean build

Expand Down Expand Up @@ -52,3 +53,12 @@ generate:
generate-native:
generate/swagger/script.sh
generate/post_swagger.sh

.PHONY: test
test:
go test ./...

.PHONY: check-commit
check-commit:
cd bin;CHECK_COMMIT=${CHECK_COMMIT} sh check-commit.sh
bin/check-commit
9 changes: 9 additions & 0 deletions bin/check-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
V=$(./check-commit tag)

if echo "$V" | grep -q "v$CHECK_COMMIT"; then
echo "$V"
else
echo "go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT"
GOBIN=$(pwd) go install github.com/haproxytech/check-commit/v5@v$CHECK_COMMIT
fi

0 comments on commit fd5b18d

Please sign in to comment.