-
Notifications
You must be signed in to change notification settings - Fork 242
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.
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 # v6 # v2 |
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.
Checkout action pinned to v2 commit, not v6
High Severity
The commit hash 8e8c483db84b4bee98b60c0593521ed34d9990e8 corresponds to actions/checkout@v2 (v2.3.4), not v6 as intended. The malformed comment # v6 # v6 # v2 appears to be an artifact of version comment concatenation, with the final # v2 reflecting the actual version. This is a major version downgrade from the previous @v6 reference, and v2 uses deprecated Node.js 12 runtime. This affects codeql.yml, lint.yml, release.yml, and test.yml.
🔬 Verification Test
Test code:
The commit hash can be verified against GitHub's actions/checkout repository.
Command run:
# Checking what tag the commit belongs to
curl -s https://api.github.com/repos/actions/checkout/git/refs/tags | grep -A2 "v2"
Why verification test was not possible: The web search was unable to directly confirm the commit hash mapping, but the malformed comment pattern # v6 # v6 # v2 strongly indicates version concatenation errors, and the final # v2 suggests the actual version of the pinned commit. The hash format and the comment pattern together indicate a mismatch between the intended v6 and the actual v2 commit being used.
Additional Locations (2)
| env: | ||
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
| with: | ||
| version: ${{ github.event.inputs.version }} |
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 optional version input lacks a default. If left blank during a manual run, it passes an empty string to the craft action, not "auto", likely causing a failure.
Severity: HIGH
🔍 Detailed Analysis
The release.yml workflow's version input was changed to be optional (required: false) without a default value. The input's description suggests that leaving it blank should trigger automatic versioning (i.e., use "auto"). However, when a user manually triggers this workflow and leaves the version field empty, GitHub Actions passes an empty string ("") instead of "auto" to the craft action. This will likely cause the release process to fail because the craft tool expects either a valid version string or the literal "auto", not an empty string.
💡 Suggested Fix
To ensure automatic versioning works as intended when the version input is left blank, add default: "auto" to the version input definition in the workflow_dispatch section. This will make "auto" the fallback value.
🤖 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#L35
Potential issue: The `release.yml` workflow's `version` input was changed to be optional
(`required: false`) without a `default` value. The input's description suggests that
leaving it blank should trigger automatic versioning (i.e., use `"auto"`). However, when
a user manually triggers this workflow and leaves the `version` field empty, GitHub
Actions passes an empty string (`""`) instead of `"auto"` to the `craft` action. This
will likely cause the release process to fail because the `craft` tool expects either a
valid version string or the literal `"auto"`, not an empty string.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8433282
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.