Skip to content

Commit aa87d55

Browse files
ci(.github/workflows): audit workflow self-references in paths (coder#25288)
Three workflows besides `deploy-docs.yaml` ([DOCS-124](https://linear.app/codercom/issue/DOCS-124), [coder#25285](coder#25285)) self-reference in their `paths:` triggers: `docker-base.yaml`, `docs-ci.yaml`, `dogfood.yaml`. This was flagged during review of coder#25285 ([DEREM-1](coder#25285 (comment))) as a bug class worth treating uniformly. This PR is the audit. Each self-reference is either justified inline or removed: * **`docker-base.yaml`** keeps the self-reference. It's PR-only and gated by `push: ${{ github.event_name != 'pull_request' }}` on the `depot/build-push-action`, so PRs build the base image without publishing. * **`docs-ci.yaml`** drops the self-reference. The `lint` and `fmt` steps gate on `tj-actions/changed-files` matching `docs/**` or `**.md`, so a workflow-only run no-ops. `actionlint` and `make lint/actions` catch YAML problems before merge regardless. * **`dogfood.yaml`** keeps the self-reference. PR runs build images without pushing and run `terraform init` + `validate` only; pushes to main retag rolling tags on `codercom/oss-dogfood`, `oss-dogfood-vscode-coder`, and `oss-dogfood-nix`, plus `terraform apply` against dev.coder.com which produces new `coderd_template` versions with unchanged content. Idempotent and bounded. Refs DOCS-121, DOCS-129. <details> <summary>Decision table</summary> | Workflow | Self-ref location | Effect on workflow-only edit | Decision | |---|---|---|---| | `deploy-docs.yaml` | push + workflow_dispatch | Destructive (DOCS-121) | Removed in [coder#25285](coder#25285) | | `docker-base.yaml` | PR-only | Build base image, never push | Keep with inline comment | | `docs-ci.yaml` | push + PR | Empty run; lint/fmt skipped by `if:` | Remove (wasted runner minutes) | | `dogfood.yaml` | push + PR | PR: build without push, terraform validate. Main: retag rolling tags, terraform apply, new cosmetic template versions | Keep with inline comment | </details> --- _Coder Agents on behalf of @nickvigilante._
1 parent 81b6132 commit aa87d55

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

.github/workflows/docker-base.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- scripts/Dockerfile
1010

1111
pull_request:
12+
# Self-reference on `pull_request` is intentional: a PR that edits this
13+
# workflow runs the build to verify the YAML is well-formed and the
14+
# base image still builds. Pushes are gated separately by
15+
# `push: ${{ github.event_name != 'pull_request' }}` on the
16+
# depot/build-push-action below, so a PR builds the image but never
17+
# publishes it. See DOCS-129 for the broader workflow-self-reference
18+
# audit.
1219
paths:
1320
- scripts/Dockerfile.base
1421
- .github/workflows/docker-base.yaml

.github/workflows/docs-ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ on:
44
push:
55
branches:
66
- main
7+
# Self-reference removed from both push and pull_request: the `lint`
8+
# and `fmt` steps gate on `tj-actions/changed-files` matching
9+
# `docs/**` or `**.md`, so a workflow-only edit produced an empty
10+
# run. `actionlint` and `make lint/actions` catch YAML problems
11+
# before merge regardless. See DOCS-129.
712
paths:
813
- "docs/**"
914
- "**.md"
10-
- ".github/workflows/docs-ci.yaml"
1115

1216
pull_request:
17+
# Self-reference removed; see comment under `push:` above.
1318
paths:
1419
- "docs/**"
1520
- "**.md"
16-
- ".github/workflows/docs-ci.yaml"
1721

1822
permissions:
1923
contents: read

.github/workflows/dogfood.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
name: dogfood
22

33
on:
4+
# Self-reference on `.github/workflows/dogfood.yaml` is intentional.
5+
# The runtime cost is bounded and the matrix runs validate the
6+
# workflow itself end to end. See DOCS-129 for the broader
7+
# workflow-self-reference audit.
8+
#
9+
# Effects vary by event:
10+
#
11+
# PRs: `build_image` builds the image variants but never pushes
12+
# (each `depot/build-push-action` step's `push:` and the
13+
# `Push Nix image` step are gated on `github.ref ==
14+
# 'refs/heads/main'`). `deploy_template` runs `terraform init` +
15+
# `validate` only; the apply step and SHA/title gathering are
16+
# gated on main.
17+
#
18+
# Pushes to main: `build_image` retags rolling tags on
19+
# `codercom/oss-dogfood` (`:latest`, `:22.04`, `:26.04`),
20+
# `codercom/oss-dogfood-vscode-coder` (`:latest`), and
21+
# `codercom/oss-dogfood-nix` (`:latest`), plus a per-branch tag on
22+
# each. `deploy_template` runs `terraform apply` and creates new
23+
# `coderd_template` versions on dev.coder.com whose `name` is the
24+
# commit short SHA. Content is unchanged when neither `dogfood/**`
25+
# nor the flake files changed, so the new versions are cosmetic.
426
push:
527
branches:
628
- main

0 commit comments

Comments
 (0)