diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..49dbbe8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,22 @@ +name: Main Workflow + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Install go-gitlint + run: make tools + + - name: Run githooks + run: ./scripts/githooks/commit-msg diff --git a/scripts/githooks/commit-msg b/scripts/githooks/commit-msg index e91555c..7d24440 100644 --- a/scripts/githooks/commit-msg +++ b/scripts/githooks/commit-msg @@ -62,7 +62,9 @@ $GITLINT_DIR \ if [ $? -ne 0 ] then if ! command -v $GITLINT_DIR &>/dev/null; then - printError "$GITLINT_DIR not found. Please run 'make tools' OR 'make tools.verify.go-gitlint' make verto install it." + printError "$GITLINT_DIR not found. Installing the go-gitlint tool..." + make tools + printError "Please make sure the installation was successful and re-run the commit-msg hook." fi printError "Please fix your commit message to match kubecub coding standards" printError "https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694#file-githook-md"