Repository navigation
Description
Problem
The repository template owns .github/workflows/release.yml and renders a caller of the reusable release workflow. A repository that publishes files after a release must change that file, so each copier update conflicts in it. release-please-config.json is also a template file: copier update and copier recopy --overwrite can remove the keys of the repository, such as draft and force-tag-creation.
The reusable release workflow also gives no commit of the release. A run for a later commit can create the release, so a publish job must not build the commit of the run.
Change
This is the library part of design B of dan-petty/devops-cli#7980 (decision of 2026-12-01).
release.ymlgets the outputsha, the commit of the release that the run created.- A new Copier answer holds the permissions of a job
publish. With the answer, the renderedrelease.ymlcalls.github/workflows/publish.ymlof the repository, only in a run that creates a release, with the inputstag-nameandsha. An empty answer renders no job. release-please-config.jsongoes into_skip_if_exists.
Done when
- The template test covers the answer, the job and the file that the repository owns.
- A repository without the answer renders the same files as before.
- A release holds the change.
Existing tool considered
Copier (answers and _skip_if_exists), GitHub reusable workflows and release-please cover the need. No script and no new tool are necessary.
Source
Source: dan-petty/devops-cli#7980
Proposed design
Problem statement
Repositories that publish files after a release must edit the rendered .github/workflows/release.yml, so each copier update conflicts in that file. release-please-config.json is a template file, so copier update and copier recopy --overwrite can remove repository keys such as draft and force-tag-creation. The reusable release workflow also gives no commit of the release, so a publish job cannot safely build the commit of the run.
Acceptance criteria
Requirement: Release workflow gives the release commit
The reusable release workflow SHALL give the commit of the release that the run created as the output sha.
Scenario: Actionlint accepts the release workflow
- WHEN I run
uv run devops ci --check --only actionlint,zizmor. - THEN The command exits 0 and reports no error for
.github/workflows/release.yml.
Requirement: Template renders the publish job
The template SHALL render a publish job in release.yml that calls ./.github/workflows/publish.yml with tag-name and sha when the Copier answer publish_permissions is not empty.
Scenario: The template test covers the publish job
- WHEN I run
bash tests/test-repository-template.sh. - THEN The test exits 0 and its case with
publish_permissionsset passes.
Requirement: Empty answer keeps the rendered files
The template SHALL render the same files as before when the Copier answer publish_permissions is empty.
Scenario: The template test covers the empty answer
- WHEN I run
bash tests/test-repository-template.sh. - THEN The test exits 0 and its case without
publish_permissionspasses.
Requirement: Repository owns release-please-config.json
The template SHALL list release-please-config.json in _skip_if_exists so that the repository owns it after the first copy.
Scenario: The template test covers the file owner
- WHEN I run
bash tests/test-repository-template.sh. - THEN The test exits 0 and its case for
_skip_if_existspasses.
Requirement: Template file owners spec lists the file
The template-file-owners spec SHALL list release-please-config.json as a file that the repository owns after the first copy.
Scenario: The spec validates
- WHEN I run
uv run devops openspec validate. - THEN The command exits 0.
Existing Tool Considered
No alternatives check has run. Copier covers the answer and _skip_if_exists; GitHub reusable workflows cover the caller job; release-please covers the release and the sha output. No script and no new tool are necessary.
Key questions
- Which file gets the publish job?: The template's caller file at
templates/repository/.github/workflows/release.ymlgets the publish job. The reusable workflow at.github/workflows/release.ymlgets theshaoutput. [sources: AGENTS.md:8, templates/README.md:68] - How does the caller get the release commit?: The reusable workflow adds the
shaoutput fromsteps.release.outputs.sha. The caller usesneeds.release.outputs.sha. [sources: .github/workflows/release.yml] - Which Copier answer holds the publish permissions?: Add a Copier answer named
publish_permissions. The answer holds the permissions of thepublishjob. An empty answer renders no job. (best practice) [sources: copier.yml:21, templates/README.md:68]- Rejected: A string answer. A string needs manual YAML indentation and cannot hold a map.
- Chosen: A YAML answer. A YAML answer holds the permissions map and Jinja can test it for emptiness.
- Should
release-please-config.jsongo into_skip_if_exists?: Yes. The repository ownsrelease-please-config.jsonafter the first copy, socopier updatekeeps its keys. (best practice) [sources: copier.yml:21, openspec/specs/template-file-owners/spec.md:10, templates/README.md:68]- Rejected: Keep the file in the template.
copier updateoverwrites the repository keys. - Chosen: Add the file to
_skip_if_exists. The repository keeps its keys after the first copy.
- Rejected: Keep the file in the template.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Dec 1, 2026
Both work on the release workflow and commit timing, but #37 fixes release creation after a late merge while the candidate adds a publish job and a sha output.chore(main): release 0.5.0 (#55)
devops-cli-service commentedon Dec 1, 2026
Released in v0.5.0: https://github.com/dan-petty/github-workflows/releases/tag/v0.5.0
devops-cli-service commentedon Dec 1, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.