Skip to content

[CI/CD-BUG] a PR is created to update version to a wrong format tag #100

@hmasdev

Description

@hmasdev

Describe the bug

The on_push_tag.yaml workflow currently triggers and creates a pull request to update the version, even when the pushed tag does not conform to the expected tag format (e.g., non-semver or irrelevant tags). This can result in unnecessary or erroneous version updates.

Environment

  • OS: [e.g. Ubuntu 22.04]
  • Browser: [e.g. Chrome 123]
  • Python Version: [e.g. 3.11]
  • GitHub Actions

To Reproduce

Steps to reproduce the behavior:

  1. Push a tag that does not match the expected version pattern (e.g., random-tag, test123, etc.)
  2. Observe that the GitHub Action on_push_tag.yaml still runs
  3. A pull request is created to update the version based on this invalid tag

Codes, Stack Traces or Screenshots

See #99 and https://github.com/hmasdev/pyjpboatrace/actions/runs/14645345522

Expected behavior

The workflow should validate the tag format before proceeding. If the tag does not match the expected pattern (e.g., vMAJOR.MINOR.PATCH), it should skip execution and avoid creating a PR.

Problems

If this bug is not fixed:

  • Versioning logic may become inconsistent
  • Unintended PRs may clutter the repository
  • Automation trustworthiness may be reduced

Reasons (Optional)

Possible cause: The current workflow lacks a tag pattern check before executing PR creation logic.

Additional context

Consider adding a conditional check early in the workflow to validate the tag name using a regex (e.g., ^v\d+\.\d+\.\d+$) before proceeding with any version updates.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions