Skip to content

fix(codegen): write generated files atomically to survive interrupted generation #3144

fix(codegen): write generated files atomically to survive interrupted generation

fix(codegen): write generated files atomically to survive interrupted generation #3144

name: Format and Generate
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
env:
GOTOOLCHAIN: local
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
fmt-and-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pull-requests: write
strategy:
matrix:
go: ["1.26", "1.25"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v5
with:
persist-credentials: "false"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ matrix.go }}
- run: go mod download
- run: .github/workflows/check-fmt
- run: .github/workflows/check-generate