Skip to content
47 changes: 10 additions & 37 deletions .github/prompts/update-project.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,14 @@ Always branch from latest `origin/main`.

## Phase 2 --- GitHub Actions Updates

1. Scan the following locations for pinned `uses:` action references:
- `.github/workflows/*.yml`
- `.github/actions/**/*.yml`
- `*/action.yml` (composite actions in subdirectories at the repository root)
2. For each external action (e.g. `actions/checkout@v6`, `docker/login-action@v4`), use the GitHub Releases API to find
the latest release tag. Check every action individually — do not assume that a major-version tag (e.g. `@v6`) is already
current. A newer major version may exist.
- If the reference uses a floating major-version tag (e.g. `@v6`) and that major version is already the latest,
leave it as-is — no update is needed.
- If the reference is pinned to a specific semver tag (e.g. `@v2.5.0`, `@v22.0.0`) and a newer version exists,
update it to the latest release tag.
- If the reference is pinned to a commit SHA, leave it as-is — do not convert SHA pins to tags.
3. Skip self-referencing actions (actions that reference the current repository, e.g.
`specsnl/github-actions/build-image@1.0.12`) — they are handled in Phase 4.
4. Update any outdated action versions in-place across all scanned files.
1. Scan `.github/workflows/*.yml` for `uses:` action references. They are pinned by commit SHA with the version in a
comment, e.g. `actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1`.
2. For each external action, use the GitHub Releases API to find the latest release tag. Check every action
individually — a newer major version may exist.
3. If a newer release exists, replace the SHA with the commit SHA of that release's tag and update the version comment.
Use the same SHA and comment everywhere the action is used.
4. Check the `rhysd/actionlint` and `zizmorcore/zizmor` versions too: update the version (and the image digest) in
`.github/workflows/lint.yml` and the matching variables in `Taskfile.dist.yml` together.
5. Check `git status` for all changed files. Commit separately if there are any changes.
Commit message: `chore(deps): Update GitHub Actions versions`.
6. If there are no changes, skip the commit step and move on to the next phase.
Expand All @@ -64,34 +57,15 @@ Abort on any failure.
Commit message: `chore: Update copyright year`.
5. If there are no changes, skip the commit step.

## Phase 4 --- Self-referencing Version Bump

1. Determine the current latest release tag of this repository using the GitHub Releases API (e.g., `1.0.12`).
2. Ask the user whether to bump the **patch** version (e.g., `1.0.12` → `1.0.13`) or the **minor** version
(e.g., `1.0.12` → `1.1.0`).
3. Compute the new version tag based on the user's choice.
4. Update all self-referencing action references across all scanned files to use the new version tag.
- Files to scan: same as Phase 2 (`.github/workflows/*.yml`, `.github/actions/**/*.yml`,
`*/action.yml`)
- Self-referencing actions are those that reference the current repository
(e.g., `specsnl/github-actions/*@<version>`)
- Update every occurrence across all files before committing — all changes go into a single commit.
5. If any files were changed, stage them all and create one commit.
Commit message: `chore: Bump self-referencing actions to <new-version>`.
6. If there are no changes, skip the commit step.

Abort on any failure.

------------------------------------------------------------------------

## Final State

Abort if there are no changes after all update steps, and inform the user that everything is already up to date.

- There could be up to 3 commits on the `vendor-updates` branch:
- There could be up to 2 commits on the `vendor-updates` branch:
1. GitHub Actions version updates
2. Copyright year update
3. Self-referencing version bump
- Branch: `vendor-updates`
- Based on latest `origin/main`.
- The working tree should be clean.
Expand All @@ -106,9 +80,8 @@ Updated the following dependencies:

- Updated GitHub Actions versions
- Updated copyright year
- Bumped self-referencing actions to <new-version>

## Post-merge tasks

- [ ] Create and push git tag `<new-version>`
- [ ] Create and push the next patch tag
```
47 changes: 21 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,35 @@
# Github Actions Workflows and Composite Actions
# Github Actions Workflows

This repository contains the Specsnl organisation collection of GitHub Actions workflows and composite actions that can
be reused to automate various tasks in GitHub repositories.
This repository contains the Specsnl organisation collection of reusable GitHub Actions workflows.

Consumers pin by tag, i.e. `specsnl/github-actions/.github/workflows/build.yml@3.1.0`.
Consumers pin by tag, i.e. `specsnl/github-actions/.github/workflows/bake.yml@4.0.0`.

## What is in here

| Kind | Name | Purpose |
|-------------------|------------------------|------------------------------------------------------------------------------|
| Composite action | `build-image` | Build one platform of an image and push it by digest, or load it for testing |
| Composite action | `create-manifest` | Merge the per-platform digests into one multi-arch manifest and tag it |
| Reusable workflow | `build.yml` | `build-image` plus the checkout / login / buildx boilerplate around it |
| Reusable workflow | `merge.yml` | `create-manifest` plus the same boilerplate |
| Reusable workflow | `build-php.yml` | Builds the PHP stages (`runtime`, `builder`) via `build.yml` |
| Reusable workflow | `merge-php.yml` | Merges those same stages via `merge.yml` |
| Reusable workflow | `build-go-cli.yml` | Builds a Go CLI image via `build.yml`, injecting the version as a build arg |
| Reusable workflow | `merge-go-cli.yml` | Merges it via `merge.yml` with the semver tag set a CLI release wants |
| Reusable workflow | `notify-slack-tag.yml` | Posts a Slack message when a tag is created |

The language-specific workflows are thin shims: they hold only the part that is actually specific to that language and
delegate everything else to the generic pair.
| Kind | Name | Purpose |
|-------------------|------------------------|--------------------------------------------------------------------------|
| Reusable workflow | `bake.yml` | Build and publish every image a repository's `docker-bake.hcl` describes |
| Bake file | `bake/specs.hcl` | The shared tag, label and annotation rules, supplied by `bake.yml` |
| Reusable workflow | `notify-slack-tag.yml` | Posts a Slack message when a tag is created |

What to build — Dockerfiles, stages, image names, platforms, build args — lives in the consuming repository's
`docker-bake.hcl`. This repository only provides how it is built and published in CI, so
`docker buildx bake --print` on a laptop shows exactly what CI will publish.

## Documentation

- [How the image pipeline works](docs/pipeline.md) — the two phases, digests, tags and what dependabot gets
- [Go CLI images](docs/go-cli.md) — version injection, the tag set, publishing variants
- [PHP images](docs/php.md) — which stages are published and under what name
- [Base images](docs/base-images.md) — why these workflows take a Dockerfile target and not a base image
- [Testing an image in a pull request](docs/testing-images.md) — building without pushing and running the result
- [Building images with bake](docs/bake.md) — the consumer's `docker-bake.hcl`, `specs.hcl`, and complete examples
- [How the image pipeline works](docs/pipeline.md) — plan, build, publish, status, and the frozen definition
- [Testing an image in a pull request](docs/testing-images.md) — building, loading and running a target
- [Base images](docs/base-images.md) — why the consumer owns its Dockerfile stages
- [Reusable workflow reference](docs/workflows.md) — every input, per workflow
- [Composite action reference](docs/actions.md) — every input and output, per action
- [Migrating from 3.x to 4.0.0](docs/migration-4.0.md) — what changed and how to move a repository over
- [Releasing this repository](docs/releasing.md) — cutting a tag consumers can pin

## Linting
## Development

```bash
task lint
task lint # actionlint and shellcheck
task zizmor # zizmor, online audits when GH_TOKEN is set
task test # specs.hcl fixture tests and the plan tests
```
66 changes: 0 additions & 66 deletions docs/actions.md

This file was deleted.

Loading
Loading