Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

ADHOC: Lint the code, then format it #4

ADHOC: Lint the code, then format it

ADHOC: Lint the code, then format it #4

Workflow file for this run

name: Build and Test
on:
pull_request:
paths:
- .github/workflows/build-and-test.yml
- go.mod
- go.sum
- '**/*.go'
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ steps.generate-token.outputs.token }}
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.23.4
- name: Install dependencies
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
- name: Build
run: make build
- name: Commit
if: ${{ github.ref != 'refs/heads/main' }}
id: commit
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@github.com
message: Automatic commit via GitHub Actions
- name: Test
if: ${{ steps.commit.outputs.committed == 'false' }}
run: make test