Skip to content

Commit

Permalink
*: Reasonable generate diff testing for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Sep 8, 2024
1 parent acbed83 commit 4b1270e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ jobs:
go generate ./...
if ! git diff --exit-code; then
echo '::error::Repository differ after `go generate`.'
exit 1
if [[ $GITHUB_REF == refs/heads/main ]]; then
echo '::error::Repository differ after `go generate`.'
exit 1
else
# Don't bother failing on non-main branches and PRs.
echo '::warning::Repository differ after `go generate`.'
fi
fi
env:
GITHUB_REF: ${{ github.ref }}

build:
name: Build
Expand Down

0 comments on commit 4b1270e

Please sign in to comment.