Cancel replaced CI runs and drop the checkout token (closes #107)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The canonical `.gitea/workflows/check.yml` gains a `concurrency` block grouped by workflow and branch with `cancel-in-progress: true`, so a new push cancels the older run on the same branch and no other, and its checkout step sets `persist-credentials: false`, so the job's token is not left in `.git/config`; `script/cibuild` needs none. Both come from `dnswatcher`, where a byte-identical re-vendor would have removed them. The workflow bullet of `prompts/REPO_POLICIES.md` and both checklists now describe the file as it is. Model: opus-5-5
This commit is contained in:
@@ -1,9 +1,16 @@
|
|||||||
name: check
|
name: check
|
||||||
on: [push]
|
on: [push]
|
||||||
|
# Free the shared runner: a new push cancels only the same branch's older run.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# actions/checkout v4.2.2, 2026-02-22
|
# actions/checkout v4.2.2, 2026-02-22
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
# script/cibuild needs no token, so none is left in .git/config.
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- run: script/cibuild
|
- run: script/cibuild
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ fmt-check, and commit.
|
|||||||
|
|
||||||
# Completed Steps
|
# Completed Steps
|
||||||
|
|
||||||
|
- 2026-10-06: The canonical `.gitea/workflows/check.yml` now has a `concurrency`
|
||||||
|
block, so a new push cancels the older run on the same branch and no other,
|
||||||
|
and its checkout step sets `persist-credentials: false`, so the job's token is
|
||||||
|
not left in `.git/config` (issue 107). `REPO_POLICIES.md` and both checklists
|
||||||
|
describe the workflow as it now is. Not yet tried on the shared runner, which
|
||||||
|
is out of disk space. Repositories pick this up on their next re-vendor.
|
||||||
- 2026-10-06: The canonical `.gitignore` and `.editorconfig` now each end with a
|
- 2026-10-06: The canonical `.gitignore` and `.editorconfig` now each end with a
|
||||||
comment saying the repository's own entries go below it and a re-vendor keeps
|
comment saying the repository's own entries go below it and a re-vendor keeps
|
||||||
them (issue 103, which took in issue 104), as `.dockerignore`'s header already
|
them (issue 103, which took in issue 104), as `.dockerignore`'s header already
|
||||||
|
|||||||
@@ -96,7 +96,9 @@ with your task.
|
|||||||
`fetch-depth: 0` on the CI checkout step, which clones shallow and fetches
|
`fetch-depth: 0` on the CI checkout step, which clones shallow and fetches
|
||||||
no tags by default.
|
no tags by default.
|
||||||
- [ ] Gitea Actions workflow in `.gitea/workflows/` runs `script/cibuild` on
|
- [ ] Gitea Actions workflow in `.gitea/workflows/` runs `script/cibuild` on
|
||||||
push — reference
|
push, checks out with `persist-credentials: false`, and carries the
|
||||||
|
`concurrency` block that lets a new push cancel only the same branch's
|
||||||
|
older run — reference
|
||||||
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.gitea/workflows/check.yml`
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.gitea/workflows/check.yml`
|
||||||
- [ ] Language-specific config:
|
- [ ] Language-specific config:
|
||||||
- [ ] Go: `go.mod`, `go.sum`, `.golangci.yml` (fetch from
|
- [ ] Go: `go.mod`, `go.sum`, `.golangci.yml` (fetch from
|
||||||
|
|||||||
@@ -106,7 +106,9 @@ Template files can be fetched from:
|
|||||||
- Non-server: the final stage brings up the dev environment
|
- Non-server: the final stage brings up the dev environment
|
||||||
- Image pinned by sha256 hash with version/date comment
|
- Image pinned by sha256 hash with version/date comment
|
||||||
- [ ] Gitea Actions workflow at `.gitea/workflows/check.yml` that runs
|
- [ ] Gitea Actions workflow at `.gitea/workflows/check.yml` that runs
|
||||||
`script/cibuild` on push — reference
|
`script/cibuild` on push, checks out with `persist-credentials: false`,
|
||||||
|
and carries the `concurrency` block that lets a new push cancel only the
|
||||||
|
same branch's older run — reference
|
||||||
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.gitea/workflows/check.yml`
|
`https://git.eeqj.de/sneak/prompts/raw/branch/main/.gitea/workflows/check.yml`
|
||||||
- [ ] Language-specific:
|
- [ ] Language-specific:
|
||||||
- [ ] Go: `go mod init sneak.berlin/go/<name>`, `.golangci.yml` (fetch from
|
- [ ] Go: `go mod init sneak.berlin/go/<name>`, `.golangci.yml` (fetch from
|
||||||
|
|||||||
@@ -283,9 +283,15 @@ style conventions are in separate documents:
|
|||||||
refuses an empty build argument drops that refusal and keeps the argument.
|
refuses an empty build argument drops that refusal and keeps the argument.
|
||||||
|
|
||||||
- Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that
|
- Every repo should have a Gitea Actions workflow (`.gitea/workflows/`) that
|
||||||
runs `script/cibuild` on push, and checks out the repo as its only other step.
|
runs `script/cibuild` on push, and checks out the repo as its only other step,
|
||||||
That script bootstraps, runs the gate phases, and then builds the image, so a
|
with `persist-credentials: false`: `script/cibuild` needs no token, and
|
||||||
successful run means every check passed; a bare `docker build .` does not
|
without it the checkout leaves the job's token in `.git/config` for every
|
||||||
|
later step. Its `concurrency` block groups runs by workflow and branch
|
||||||
|
(`${{ github.workflow }}-${{ github.ref }}`) with `cancel-in-progress: true`,
|
||||||
|
so a new push cancels the older run on the same branch, queued or running, and
|
||||||
|
no other: runs for replaced commits do not hold up the shared runner.
|
||||||
|
`script/cibuild` bootstraps, runs the gate phases, and then builds the image,
|
||||||
|
so a successful run means every check passed; a bare `docker build .` does not
|
||||||
carry the same guarantee, because its gate phases may come from the cache. The
|
carry the same guarantee, because its gate phases may come from the cache. The
|
||||||
image build is uncached and so runs the gate phases a second time. That is the
|
image build is uncached and so runs the gate phases a second time. That is the
|
||||||
price of the rule above, and it is worth paying: the image that ships is built
|
price of the rule above, and it is worth paying: the image that ships is built
|
||||||
|
|||||||
Reference in New Issue
Block a user