Skip to content

ci: add print to check out #66

ci: add print to check out

ci: add print to check out #66

Workflow file for this run

name: Go
on:
workflow_call:
workflow_dispatch:
pull_request:
push:
branches:
- '**'
- '!main'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '>=1.23'
- name: Install dependencies
run: go get .
- name: Check formating
run: |
changedFiles=$(go fmt ./...)
if [[ -n $changedFiles ]]; then
echo -e "Follwing files are not formated:\n${changedFiles}"
exit 1
fi
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
- name: Run tests
run: go test -cover ./...
- name: test build
run: go build -o convcommitlint
- uses: actions/upload-artifact@v4
with:
name: convcommitlint
path: convcommitlint
check-commits:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: 'get base branch last commit'
run: git fetch origin main:main --depth 1
shell: bash
if: ${{ github.ref_name != 'main' }}
- uses: actions/download-artifact@v4
with:
name: convcommitlint
- name: chmod +x
run: chmod +x convcommitlint
- name: check commits
run: ./convcommitlint -b main --create-review="true" --comment-drafts="false"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}