Skip to content

Validate release tags before running release steps - #5356

Merged
mnriem merged 2 commits into
github:mainfrom
mnriem:mnriem-release-tag-injection
Nov 10, 2026
Merged

mnriem merged 2 commits into
github:mainfrom
mnriem:mnriem-release-tag-injection

Conversation

@mnriem

@mnriem mnriem commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Description

Require release tags to match the documented vMAJOR.MINOR.PATCH format and stop the release job immediately when a tag is malformed. Pass the validated version to subsequent steps through environment variables. Update the release-process documentation and add coverage for tag validation and the release-step sequence.

Testing

Set up this checkout's .venv and editable install using the local development guide. Run commands from the checkout root.

  • Tested locally with .venv/bin/specify --help (Windows PowerShell: .\.venv\Scripts\specify.exe --help)
  • Ran relevant existing tests with .venv/bin/python -m pytest tests -q (Windows PowerShell: .\.venv\Scripts\python.exe -m pytest tests -q); use affected test paths for focused checks and LC_ALL=en_US.UTF-8 on macOS
  • Tested with a sample project (if applicable)

.venv/bin/specify --help passed.

LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests/test_github_workflows.py -q passed: 203 tests, including 10 local release-sequence simulations using temporary Git repositories and mocked GitHub calls. No live release was published. The full test suite was not run; a sample project is not applicable.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (fill in the disclosure below)

AI disclosure: GitHub Copilot using GPT-6.1 Sol (model ID: gpt-6.1-sol), runtime-default reasoning settings and autonomous execution within a user-directed scope, generated the implementation, tests, documentation, and PR description and ran local validation. An additional read-only Copilot agent assisted with analysis; its model was not reported by the tool.

Require the documented version format, pass versions through step environments, and cover the release sequence with local simulations.

Assisted-by: GitHub Copilot (model: gpt-6.1-sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings November 9, 2026 23:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The quoted-tag test fails under Git-for-Windows Bash before reaching workflow validation because Windows disallows double quotes in loose-ref filenames.

1 open issue
What changed in this PR

This PR hardens Spec Kit’s release workflow by validating release tags before running release commands and passing the validated version to subsequent shell steps as data.

Changes:

  • Reject malformed tags before publishing the version output.
  • Replace direct version interpolation with environment variables.
  • Document validation behavior and add tests for valid tags, malformed inputs, and release-step sequencing.
File Description
tests/​test_github_workflows.py Adds tag-validation, injection-safety, and release-sequence tests.
.github/​workflows/​release.yml Validates tags and passes versions through environment variables.
.github/​workflows/​RELEASE-PROCESS.md Documents early validation and safe version handling.

Review effort: Balanced (auto)

Comment thread tests/test_github_workflows.py Resolved
Limit the platform skip to the real-tag simulation and retain quoted-tag coverage in shell-only validation.

Assisted-by: GitHub Copilot (model: gpt-6.1-sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings November 9, 2026 23:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the release-workflow hardening changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced (auto)

@mnriem
mnriem merged commit 08252af into github:main Nov 10, 2026
16 checks passed
@mnriem
mnriem deleted the mnriem-release-tag-injection branch November 10, 2026 01:57
kevinnguyenhoang91 pushed a commit to kevinnguyenhoang91/spec-kit that referenced this pull request Nov 10, 2026
* Validate release tags before running release steps

Require the documented version format, pass versions through step environments, and cover the release sequence with local simulations.

Assisted-by: GitHub Copilot (model: gpt-6.1-sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Skip quoted loose-ref simulation on Windows

Limit the platform skip to the real-tag simulation and retain quoted-tag coverage in shell-only validation.

Assisted-by: GitHub Copilot (model: gpt-6.1-sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants