-
Notifications
You must be signed in to change notification settings - Fork 243
ci(release): Switch from action-prepare-release to Craft #1167
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: master
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
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 }} |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
.github/workflows/release.yml
Outdated
| env: | ||
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
| with: | ||
| version: ${{ github.event.inputs.version }} |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
| description: Version to release | ||
| required: true | ||
| description: Version to release (or "auto") | ||
| required: false |
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.
Missing default value for optional version input
Medium Severity
The version input was changed from required: true to required: false and the description mentions "(or "auto")", but no default value is specified. When users trigger the workflow without providing a version, github.event.inputs.version resolves to an empty string rather than "auto". This empty string gets passed to the getsentry/craft action, which may cause unexpected behavior or failure if the action doesn't treat empty strings as "auto".
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Build / dependencies / internal 🔧Deps
Other
🤖 This preview updates automatically when you update the PR. |
| version: | ||
| description: Version to release | ||
| required: true | ||
| description: Version to release (or "auto") | ||
| required: false |
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: The version input in the release workflow is optional but lacks a default: 'auto'. When omitted, it passes an empty string, not 'auto', causing the workflow to fail.
Severity: CRITICAL
Suggested Fix
In .github/workflows/release.yml, add default: "auto" to the version input definition to ensure that the Craft action receives the correct value when no version is manually specified.
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#L5-L7
Potential issue: The `release.yml` workflow defines the `version` input as optional
(`required: false`) to allow for an 'auto' mode, but it lacks a `default` value. When a
user triggers the workflow without providing a version, GitHub Actions passes an empty
string `""` to `github.event.inputs.version`. The workflow then passes this empty string
to the Craft action. The Craft action expects a specific version or the literal string
`'auto'`, not an empty string, which will likely cause the release workflow to fail when
the user intends to use the auto-versioning feature.
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
This PR migrates from the deprecated
action-prepare-releaseto the new Craft GitHub Actions.Changes
.github/workflows/release.ymlto Craft reusable workflowDocumentation
See https://getsentry.github.io/craft/github-actions/ for more information.