[WIP] Fix skipped create release job in workflow#9
Conversation
Co-authored-by: RusEu <11183790+RusEu@users.noreply.github.com>
Co-authored-by: RusEu <11183790+RusEu@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses an issue where the release job in the GitHub Actions workflow was always being skipped. The fix modifies both the workflow trigger pattern and the release job condition to be more permissive, allowing any tag (not just those with a 'v' prefix) to trigger releases.
Key Changes:
- Updated tag trigger pattern from
'v*'to'*'to accept all tags - Modified release job condition from
startsWith(github.ref, 'refs/tags/v')tostartsWith(github.ref, 'refs/tags/')for consistency
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - master | ||
| tags: | ||
| - 'v*' | ||
| - '*' |
There was a problem hiding this comment.
The wildcard pattern '' will trigger the workflow for any tag, including non-release tags (e.g., experimental tags, build tags, etc.). This could cause unintended releases to be created. Consider using a more specific pattern like 'v' or '[0-9]+.' to match only semantic version tags. If you need to support tags both with and without the 'v' prefix, consider using 'v[0-9]+.' for tags with prefix, or establish a clear tagging convention for releases.
| - '*' | |
| - 'v*' |
| needs: build | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| if: startsWith(github.ref, 'refs/tags/') |
There was a problem hiding this comment.
While this change makes the condition consistent with the trigger pattern and fixes the skipped job issue, it also means ANY tag will trigger a release. This could lead to accidental releases from non-version tags. Consider being more specific, such as checking if the tag matches a version pattern using a regex or conditional expression. For example, you could add an additional condition to verify the tag format matches semantic versioning expectations.
| if: startsWith(github.ref, 'refs/tags/') | |
| if: startsWith(github.ref, 'refs/tags/') && github.ref_name matches '^v?[0-9]+\.[0-9]+\.[0-9]+$' |
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.