Skip to content

fix(ci): add write permissions #110

fix(ci): add write permissions

fix(ci): add write permissions #110

Workflow file for this run

name: CI
on:
push:
tags: [ 'v*' ]
branches: [ main ]
pull_request:
permissions:
contents: write
env:
GOLANG_VERSION: 1.21.x
jobs:
lint:
name: lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test ./...
release:
runs-on: ubuntu-24.04
needs: [ lint, test ]
if: startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
# Required to build changeleg
- name: Unshallow
run: git fetch --prune --unshallow
# Setup go
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: ${{ env.GOLANG_VERSION }}
# Runs the goreleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}