Skip to content

feat(validatereleasetag): validate release tag - #69

Open
jacopocinaark wants to merge 2 commits into
masterfrom
feature/22954-ValidateReleaseTag
Open

feat(validatereleasetag): validate release tag#69
jacopocinaark wants to merge 2 commits into
masterfrom
feature/22954-ValidateReleaseTag

Conversation

@jacopocinaark

@jacopocinaark jacopocinaark commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

ref: AB#22954

Copilot AI lite review requested due to automatic review settings August 18, 2026 08:58
@jacopocinaark
jacopocinaark requested a review from a team as a code owner August 18, 2026 08:58

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.

Pull request overview

Adds explicit release-tag validation to the GitHub Actions publish flow so PyPI publishing only proceeds for GA-style tags (vX.Y.Z), aligning the workflow trigger/conditions with tag-based releases.

Changes:

  • Broadened workflow tag trigger to v* (GitHub Actions tag patterns are glob-based).
  • Restricted the publish job to run only on tag pushes (refs/tags/v...), not master pushes.
  • Added a bash validation step that hard-fails publishing when the tag is not exactly v<major>.<minor>.<patch>.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/python-tests.yml Outdated
branches: [master]
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
- "v*"

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.

previous match was more correct. "v*" matches also "vaffanzul"

if: ${{ always() }}

publish:
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))

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.

this triggers on any push on master?! tags are not master ...
this clearly has not been tested

run: |
TAG="${GITHUB_REF_NAME}"

if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then

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.

where is the ancestor branch check?
this only check that the tag is a semver release, doens't ensure is on master branch.

Copilot AI review requested due to automatic review settings August 19, 2026 12:19

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

.github/workflows/python-tests.yml:104

  • The validation hard-codes master in both the fetch and the ancestry check. This adds another place to update if the default branch name changes; the workflow already has access to the repo default branch via the event payload.
          git fetch origin master

          if ! git merge-base --is-ancestor "$GITHUB_SHA" "origin/master"; then
            echo "::error::Release tag $TAG does not point to a commit contained in master."
            exit 1

Comment on lines 76 to 78
publish:
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v'))
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
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.

3 participants