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

Fix GitHub Actions run by installing go-gitlint tool #110

Closed
wants to merge 7 commits into from
Closed
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
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16

- name: Install go-gitlint

- name: Install typos tool
run: ./scripts/install_typos.sh

- name: Install or Verify go-gitlint
run: make tools || make tools.verify.go-gitlint

- name: Check for typos
run: typos --write-changes

- name: Run commit-msg githook
run: ./.git/hooks/commit-msg

- name: Run tests
run: go test ./... -v

- name: Build
run: go build -v .
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,13 @@ Please obey the following rules to better format the docs, which would greatly i
5. Please use the correct case for technical terms, such as using `HTTP` instead of http, `MySQL` rather than mysql, `Kubernetes` instead of kubernetes, etc.
6. Please check if there's any typos in the docs before submitting PRs.

## Engage to help anything
## Typo Checker Tool

`typos` is a fast source code spell checker that helps to identify and correct typos in your source code. It is integrated into the GitHub Actions workflow to ensure the quality of contributions by automatically detecting typographical errors. It is integrated into the GitHub Actions workflow to ensure the quality of contributions by automatically detecting typographical errors.\n\n### Installing `typos`

To install the `typos` tool on your local machine, run the `install_typos.sh` script located in the `scripts` directory. This script will download the tool and place it in the `tools` directory for use. This script will download the tool and place it in the `tools` directory for use.\n\n```bash
./scripts/install_typos.sh
```\n\nPlease make sure to run the typo checker before submitting your pull request as any typographical errors detected by the tool will result in a failed check.\n\n## Engage to help anything

We choose GitHub as the primary place for github-label-syncer to collaborate. So the latest updates of github-label-syncer are always here. Although contributions via PR is an explicit way to help, we still call for any other ways.

Expand Down
13 changes: 13 additions & 0 deletions scripts/install_typos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Download the typos tool
curl -L https://github.com/crate-ci/typos/releases/download/1.0.14/typos-x86_64-unknown-linux-gnu.tar.gz -o typos.tar.gz

# Extract the downloaded file
tar -xvf typos.tar.gz

# Move the typos tool to the tools directory
mv typos ./tools/

# Clean up the downloaded file
rm typos.tar.gz
Loading