Skip to content

refactor: (DSP-2004) Apply good practice to code #6

refactor: (DSP-2004) Apply good practice to code

refactor: (DSP-2004) Apply good practice to code #6

Workflow file for this run

name: πŸ“ Lint
on:
pull_request:
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: πŸ’» Checkout current code ref
uses: actions/checkout@v4
- name: πŸ”΅ Set up Go on runner
uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: πŸ’¬ Run go formatting
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
- name: 🌷 Run lint
uses: golangci/[email protected]
with:
version: v1.54
commitlint:
runs-on: ubuntu-latest
steps:
- name: πŸ’» Checkout current code ref
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 🟒 Configure Node.js on runner
uses: actions/setup-node@v4
with:
node-version-file: '.tool-versions'
- name: 🚧 Install dev dependencies
run: npm install --only=dev
# Check all commits pushed to this PR
- name: πŸ‘οΈβ€πŸ—¨οΈ Validate PR commits with commitlint
run: >-
npx commitlint
--from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }}
--to ${{ github.event.pull_request.head.sha }}
--verbose
- name: πŸ”Ž Validate PR title with commitlint
run: echo "${{ github.event.pull_request.title }}" | npx commitlint