-
-
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?
Changes from 4 commits
27c1164
ae3a830
374d1e9
b3439ee
2013c59
d550032
d5ae02a
a4185ff
84256d0
67b09bb
df15def
3af0032
135932b
5d99249
e848f5d
c399972
93401a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Changelog Preview | ||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened | ||
| - edited | ||
| - labeled | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| changelog-preview: | ||
| uses: getsentry/craft/.github/workflows/changelog-preview.yml@v2 | ||
| secrets: inherit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,38 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Version to release (optional) | ||
| description: Version to release (or "auto") | ||
| required: false | ||
| force: | ||
| description: Force a release even when there are release-blockers (optional) | ||
| description: Force a release even when there are release-blockers | ||
| required: false | ||
|
|
||
| schedule: | ||
| # We want the release to be at 9-10am Pacific Time | ||
| # We also want it to be 1 hour before the self-hosted release | ||
| - cron: "0 17 15 * *" | ||
|
|
||
| - cron: "0 17 15 * *" | ||
| permissions: | ||
| contents: write # required to create a release | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| name: Release a new ${{ github.repository }} version | ||
|
|
||
| name: Release a new version | ||
| steps: | ||
| - name: Get auth token | ||
| id: token | ||
| uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 | ||
| with: | ||
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
| with: | ||
| token: ${{ steps.token.outputs.token }} | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Prepare release | ||
| uses: getsentry/action-prepare-release@3cea80dc3938c0baf5ec4ce752ecb311f8780cdc # v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
| with: | ||
| version: ${{ github.event.inputs.version }} | ||
| force: ${{ github.event.inputs.force }} | ||
| calver: true | ||
| - name: Get auth token | ||
| id: token | ||
| uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v2 | ||
| with: | ||
| app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} | ||
| private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3 # v2 | ||
| with: | ||
| token: ${{ steps.token.outputs.token }} | ||
| fetch-depth: 0 | ||
| - name: Prepare release | ||
| uses: getsentry/craft@39ee616a6a58dc64797feecb145d66770492b66c # v2 | ||
| env: | ||
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
| with: | ||
| 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 thecraftaction to fail as it might not accept an emptyversionstring.Severity: CRITICAL
🔍 Detailed Analysis
The
release.ymlworkflow is triggered on a schedule and byworkflow_dispatch. For scheduled runs, theinputscontext is empty. Consequently, theversionandforceparameters passed to thecraftaction will be empty strings. While the PR adds aversioning: policy: calverconfiguration, which might be intended to handle this, there is a risk that thecraftaction does not interpret an empty string as a request for auto-versioning and will instead fail, as it's documented to reject emptyversioninputs. This would cause all scheduled releases to fail.💡 Suggested Fix
Provide a default value for the
versionandforceinputs to handle scheduled runs where theinputscontext is empty. For example:version: ${{ inputs.version || 'auto' }}andforce: ${{ inputs.force || false }}.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID:
8427358