Skip to content

Fix

Fix #26

Workflow file for this run

name: golangci-lint
on:
push:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Find base branch
id: find_base_branch
run: |
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
BASE_BRANCH=$(git merge-base --fork-point origin/$DEFAULT_BRANCH HEAD || echo "origin/$DEFAULT_BRANCH")
echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_ENV
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
args: --config .github/.golangci.yml --new-from-rev ${{ env.BASE_BRANCH }}