Copier Update

Run copier update and open or update a template-sync PR.

Usage

jobs:
  template-update:
    uses: athackst/ci/.github/workflows/copier_update.yml@main
    with:
      answers-file: .copier-answers.docs.yml
      managed-paths: |
        docs
        mkdocs.yml
      pr-branch: ci/update-docs-template
      pr-title: "chore: update docs template"
      commit-message: "chore: apply docs template update"
    secrets:
      token: $

Inputs

Name Description Default
create-pr (optional) Create or update a PR with template changes. true
pr-branch (optional) Branch name used for template updates. copier/update-template
pr-title (optional) Pull request title. chore: update Copier template
pr-labels (optional) Comma-separated list of labels to apply to the PR. ""
commit-message (optional) Commit message for template updates. chore: apply Copier template update
checkout-ref (optional) Git ref to check out before applying template updates. ""
template-ref (optional) Copier template ref to update from. Defaults to checkout-ref, then HEAD. ""
answers-file (optional) Copier answers file to use for the update. .copier-answers.yml
managed-paths (optional) Newline-delimited paths managed by the template, excluding the answers file. Use . to include all files. .

Secrets

Name Description Required
token (optional) Token used for checkout, push, PR operations, failure issue maintenance, and label setup. No

Outputs

Name Description
changed Whether template changes were produced by Copier.
changed-files Newline-delimited list of Copier-managed files changed by the update.
branch Branch name used for the update, whether a PR was created or changes were pushed directly.
pr-url URL for the updater PR, if one was created or updated.

Permissions

  • Requires contents: write, pull-requests: write, issues: write, and actions: write.
  • actions: write is needed when template updates modify .github/workflows/*.

Advanced

  • Skips the Copier update entirely when the configured answers file is missing.
  • Only changes under the configured managed paths and answers file count toward the changed output, so other files do not open an update PR.
  • Logs the managed-file status, diffstat, and diff from the Detect changes step and includes the changed file list in successful update summaries.
  • Fails before PR creation or branch push when Copier leaves merge conflicts in managed files, lists the conflicted files in the workflow summary, and prints index entries plus the managed diff in the log.
  • Creates or updates one open failure issue with updater context and a local repro command if the workflow fails, then comments on and closes the issue after a later successful run.
  • Writes a final workflow summary for both the PR and direct-push paths.

Examples

Disable PR creation and just validate the update path:

jobs:
  template-update:
    uses: athackst/ci/.github/workflows/copier_update.yml@main
    with:
      create-pr: false
      answers-file: .copier-answers.docs.yml
      managed-paths: docs
    secrets:
      token: $