Skip to content

test(ci): add an invalid commit to confirm that CI catches it #5

test(ci): add an invalid commit to confirm that CI catches it

test(ci): add an invalid commit to confirm that CI catches it #5

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
paths:
- "**.go"
- go.mod
- go.sum
pull_request:
branches: [ main ]
paths:
- "**.go"
- go.mod
- go.sum
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build
run: go build -v ./cmd/gh-not
- name: Test
run: go test -v ./...
# Taken from https://github.com/cli/cli/blob/trunk/.github/workflows/lint.yml
- name: Lint
run: |
STATUS=0
assert-nothing-changed() {
local diff
"$@" >/dev/null || return 1
if ! diff="$(git diff -U1 --color --exit-code)"; then
printf '\e[31mError: running `\e[1m%s\e[22m` results in modifications that you must check into version control:\e[0m\n%s\n\n' "$*" "$diff" >&2
git checkout -- .
STATUS=1
fi
}
assert-nothing-changed go fmt ./...
assert-nothing-changed go mod tidy
exit $STATUS