Skip to content

feat(ci): call a publish workflow after a release #48

Done

Description

@dan-petty

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).

  1. release.yml gets the output sha, the commit of the release that the run created.
  2. A new Copier answer holds the permissions of a job publish. With the answer, the rendered release.yml calls .github/workflows/publish.yml of the repository, only in a run that creates a release, with the inputs tag-name and sha. An empty answer renders no job.
  3. release-please-config.json goes 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_permissions set 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_permissions passes.

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_exists passes.

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.yml gets the publish job. The reusable workflow at .github/workflows/release.yml gets the sha output. [sources: AGENTS.md:8, templates/README.md:68]
  • How does the caller get the release commit?: The reusable workflow adds the sha output from steps.release.outputs.sha. The caller uses needs.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 the publish job. 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.json go into _skip_if_exists?: Yes. The repository owns release-please-config.json after the first copy, so copier update keeps 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 update overwrites the repository keys.
    • Chosen: Add the file to _skip_if_exists. The repository keeps its keys after the first copy.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. dan-petty commented on Dec 1, 2026

    @dan-petty
    OwnerAuthor
  2. added
    type/feature
    status/new
    value/medium
    effort/medium
    source/agent
    scope/ci
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Dec 1, 2026
  3. added a commit that references this issue on Dec 1, 2026
  4. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  5. removed
    status/in-review
    owner/agent
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/cisource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions