-
-
Notifications
You must be signed in to change notification settings - Fork 5
ci(release): Switch from action-prepare-release to Craft #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This PR migrates from the deprecated action-prepare-release to the new Craft GitHub Actions (reusable workflow or composite action). Changes: - Migrate .github/workflows/release.yml to Craft reusable workflow - Update .craft.yml with versioning.policy: calver
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Uptime
Build / dependencies / internal 🔧
🤖 This preview updates automatically when you update the PR. |
The previous migration incorrectly removed the GitHub App token authentication step. This commit restores it by switching to the composite action pattern which preserves the auth flow.
.github/workflows/release.yml
Outdated
| version: ${{ inputs.version }} | ||
| force: ${{ inputs.force }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: During scheduled runs, ${{ inputs.version }} will be empty, which may cause the craft action to fail as it might not accept an empty version string.
Severity: CRITICAL
🔍 Detailed Analysis
The release.yml workflow is triggered on a schedule and by workflow_dispatch. For scheduled runs, the inputs context is empty. Consequently, the version and force parameters passed to the craft action will be empty strings. While the PR adds a versioning: policy: calver configuration, which might be intended to handle this, there is a risk that the craft action does not interpret an empty string as a request for auto-versioning and will instead fail, as it's documented to reject empty version inputs. This would cause all scheduled releases to fail.
💡 Suggested Fix
Provide a default value for the version and force inputs to handle scheduled runs where the inputs context is empty. For example: version: ${{ inputs.version || 'auto' }} and force: ${{ inputs.force || false }}.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/workflows/release.yml#L37-L38
Potential issue: The `release.yml` workflow is triggered on a schedule and by
`workflow_dispatch`. For scheduled runs, the `inputs` context is empty. Consequently,
the `version` and `force` parameters passed to the `craft` action will be empty strings.
While the PR adds a `versioning: policy: calver` configuration, which might be intended
to handle this, there is a risk that the `craft` action does not interpret an empty
string as a request for auto-versioning and will instead fail, as it's documented to
reject empty `version` inputs. This would cause all scheduled releases to fail.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8427358
.github/workflows/release.yml
Outdated
| version: ${{ inputs.version }} | ||
| force: ${{ inputs.force }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: On scheduled runs, inputs.version and inputs.force will be empty strings, which may cause the getsentry/craft action to fail if it doesn't handle empty inputs.
Severity: HIGH
🔍 Detailed Analysis
The GitHub workflow is configured to run on a schedule. During a scheduled run, the inputs context is empty, causing ${{ inputs.version }} and ${{ inputs.force }} to be passed as empty strings to the getsentry/craft@v2 action. If this action does not gracefully handle empty string values for these parameters, the scheduled release process will fail. While it is plausible the action is designed to handle this, as its author wrote this workflow, the behavior is unconfirmed and could lead to a failure in the automated release pipeline.
💡 Suggested Fix
To ensure the workflow is robust, add a fallback value for the version parameter. For example, use ${{ inputs.version || 'auto' }} to explicitly use the 'auto' versioning feature during scheduled runs, assuming this is the intended default behavior for the Craft action.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: .github/workflows/release.yml#L37-L38
Potential issue: The GitHub workflow is configured to run on a schedule. During a
scheduled run, the `inputs` context is empty, causing `${{ inputs.version }}` and `${{
inputs.force }}` to be passed as empty strings to the `getsentry/craft@v2` action. If
this action does not gracefully handle empty string values for these parameters, the
scheduled release process will fail. While it is plausible the action is designed to
handle this, as its author wrote this workflow, the behavior is unconfirmed and could
lead to a failure in the automated release pipeline.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8473281
Summary
This PR migrates from the deprecated
action-prepare-releaseto the new Craft GitHub Actions.Changes
.github/workflows/release.ymlto Craft reusable workflow.craft.ymlwithversioning.policy: calverDocumentation
See https://getsentry.github.io/craft/github-actions/ for more information.