Skip to content

feat: add release workflow with beta tag management#171

Merged
ashwin-ant merged 1 commit intomainfrom
ashwin/releaseaction
Jun 13, 2025
Merged

feat: add release workflow with beta tag management#171
ashwin-ant merged 1 commit intomainfrom
ashwin/releaseaction

Conversation

@ashwin-ant
Copy link
Collaborator

@ashwin-ant ashwin-ant commented Jun 13, 2025

Essentially the same as https://github.com/anthropics/claude-code-base-action/blob/main/.github/workflows/release.yml

  • Auto-increment patch version for new releases
  • Update beta tag to point to latest release
  • Update major version tag (v0) for simplified action usage
  • Support dry run mode for testing
  • Keep beta as the "latest" release channel

🤖 Generated with Claude Code

- Auto-increment patch version for new releases
- Update beta tag to point to latest release
- Update major version tag (v0) for simplified action usage
- Support dry run mode for testing
- Keep beta as the "latest" release channel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude
Copy link
Contributor

claude bot commented Jun 13, 2025

Claude finished @ashwin-ant's task —— View job


PR Review: Release Workflow with Beta Tag Management

Todo List:

  • Read and analyze the new release workflow file
  • Evaluate GitHub Actions best practices and security
  • Check workflow logic and design decisions
  • Provide detailed feedback and suggestions
  • Complete review summary

🔍 Overall Assessment

This is a well-structured release workflow that implements automated version management with beta tag support. The design is solid with good separation of concerns across three jobs.

✅ Strengths

1. Security & Permissions

  • Proper use of contents: write permissions (minimal required scope)
  • Uses github.token instead of hardcoded tokens
  • Bot user configuration follows GitHub best practices

2. Workflow Design

  • Clean job separation with appropriate dependencies
  • Dry-run mode for testing - excellent for CI/CD safety
  • Proper use of workflow outputs for data passing between jobs
  • Good conditional logic to skip operations in dry-run mode

3. Git Operations

  • Uses fetch-depth: 0 for full history access
  • Proper version sorting with sort -V
  • Fallback handling for initial releases (v0.0.0)
  • Annotated tags with meaningful commit messages

⚠️ Areas for Improvement

1. Error Handling & Robustness

Issue in .github/workflows/release.yml:99-100:

VERSION=$(git tag -l 'v[0-9]*' | sort -V | tail -1)

Problem: If no version tags exist, this could return empty string, causing issues in subsequent steps.
Suggestion: Add fallback logic like in the first job:

VERSION=$(git tag -l 'v[0-9]*' | sort -V | tail -1 || echo "v0.0.0")
if [ -z "$VERSION" ]; then
  VERSION="v0.0.0"
fi

2. Beta Release Assumption

Issue in .github/workflows/release.yml:112:

gh release edit beta --latest

Problem: This assumes a "beta" release already exists. If it doesn't, the command will fail.
Suggestion: Add existence check or create beta release if it doesn't exist:

if gh release view beta >/dev/null 2>&1; then
  gh release edit beta --latest
else
  echo "Beta release doesn't exist, will be created on next beta workflow run"
fi

3. Race Condition Risk

Issue in workflow structure:
Both update-beta-tag and update-major-tag jobs depend on create-release but run in parallel. They both:

  • Fetch latest tags from git
  • Push force updates to remote

Problem: Potential race condition where both jobs read git state before either writes.
Suggestion: Consider making update-major-tag depend on update-beta-tag completion, or ensure both jobs use the output from create-release job instead of re-querying git.

4. Version Parsing Robustness

Issue in .github/workflows/release.yml:41-48:
The version parsing assumes semantic versioning format but could be more defensive:

# Current approach
version=${latest_tag#v}
IFS='.' read -ra VERSION_PARTS <<< "$version"
major=${VERSION_PARTS[0]:-0}
minor=${VERSION_PARTS[1]:-0}
patch=${VERSION_PARTS[2]:-0}

Suggestion: Add validation for malformed version tags:

if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
  echo "Warning: Invalid version format '$version', using 0.0.0"
  version="0.0.0"
fi

💡 Enhancement Suggestions

1. Add Changelog Generation
Consider adding automatic changelog generation between releases:

- name: Generate changelog
  run: |
    git log --oneline ${{ steps.get_latest_tag.outputs.latest_tag }}..HEAD > CHANGELOG.tmp

2. Release Validation
Add a step to validate the release was created successfully before proceeding to tag updates.

3. Notification Support
Consider adding Slack/Discord notifications for successful releases.

🏗️ Architecture Feedback

Design Decision Analysis:

  • Beta as "latest": Good choice for a pre-release action where users want the most recent updates
  • Patch auto-increment: Appropriate for automated releases, though consider adding support for manual version bumps
  • Force tag updates: Necessary for moving tags, but document this behavior for team awareness
  • Job separation: Excellent modularity that allows for future extensions

🔧 Minor Improvements

Code Quality:

  1. Line 82: Comment formatting could be improved:

    --latest=false  # Keep beta as the latest release channel
  2. Consider extracting the git config setup into a reusable step template to reduce duplication.

📝 Summary

This is a solid implementation that demonstrates good understanding of GitHub Actions patterns and release management. The workflow correctly handles the complex requirements of managing multiple tag types while maintaining beta as the latest release.

Priority fixes:

  1. Add error handling for missing version tags in update-beta-tag job
  2. Add beta release existence check
  3. Consider job dependency ordering to prevent race conditions

Overall recommendation: ✅ Approve with minor fixes - The workflow is production-ready with the suggested error handling improvements.

@ashwin-ant ashwin-ant requested a review from a team June 13, 2025 21:41
@ashwin-ant ashwin-ant merged commit ffb2927 into main Jun 13, 2025
5 checks passed
@ashwin-ant ashwin-ant deleted the ashwin/releaseaction branch June 13, 2025 21:43
ashwin-ant added a commit that referenced this pull request Jun 16, 2025
- Auto-increment patch version for new releases
- Update beta tag to point to latest release
- Update major version tag (v0) for simplified action usage
- Support dry run mode for testing
- Keep beta as the "latest" release channel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
ashwin-ant added a commit that referenced this pull request Jun 16, 2025
…xecution (#164)

* feat: enhance error reporting with specific error types from Claude execution

- Extract error subtypes (error_during_execution, error_max_turns) from result object
- Display specific error messages in comment header based on error type
- Use total_cost_usd field from SDKResultMessage type
- Prevent showing redundant error details when already displayed in header

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update claude-code-base-action to v0.0.19

* feat: use GitHub display name in Co-authored-by trailers (#163)

* feat: use GitHub display name in Co-authored-by trailers

- Add name field to GitHubAuthor type
- Update GraphQL queries to fetch user display names
- Add triggerDisplayName to CommonFields type
- Extract display name from fetched GitHub data in prepareContext
- Update Co-authored-by trailer generation to use display name when available

This ensures consistency with GitHub's web interface behavior where
Co-authored-by trailers use the user's display name rather than username.

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix: update GraphQL queries to handle Actor type correctly

The name field is only available on the User subtype of Actor in GitHub's
GraphQL API. This commit updates the queries to use inline fragments
(... on User) to conditionally access the name field when the actor is
a User type.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: clarify Co-authored-by instructions in prompt

Replace interpolated values with clear references to XML tags and add
explicit formatting instructions. This makes it clearer how to use the
GitHub display name when available while maintaining the username for
the email portion.

Changes:
- Use explicit references to <trigger_display_name> and <trigger_username> tags
- Add clear formatting instructions and example
- Explain fallback behavior when display name is not available

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: fetch trigger user display name via dedicated GraphQL query

Instead of trying to extract the display name from existing data (which
was incomplete due to Actor type limitations), we now:

- Add a dedicated USER_QUERY to fetch user display names
- Pass the trigger username to fetchGitHubData
- Fetch the display name during data collection phase
- Simplify prepareContext to use the pre-fetched display name

This ensures we always get the correct display name for Co-authored-by
trailers, regardless of where the trigger came from.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* feat: use dynamic fetch depth based on PR commit count (#169)

- Replace fixed depth of 20 with dynamic calculation
- Use Math.max(commitCount, 20) to ensure minimum context

* Accept multiline input for allowed_tools and disallowed_tools (#168)

* docs: add uv example for Python MCP servers in mcp_config section (#170)

Added documentation showing how to configure Python-based MCP servers using uv
with the --directory argument, as requested in issue #130.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com>

* feat: add release workflow with beta tag management (#171)

- Auto-increment patch version for new releases
- Update beta tag to point to latest release
- Update major version tag (v0) for simplified action usage
- Support dry run mode for testing
- Keep beta as the "latest" release channel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>

* chore: update claude-code-base-action to v0.0.20

* update MCP server image to version 0.5.0 (#175)

* refactor: convert error subtype check to switch case

Replace if-else chain with switch statement for better readability
and maintainability when handling error subtypes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
Co-authored-by: Bastian Gutschke <bge@medicuja.com>
Co-authored-by: Hidetake Iwata <int128@gmail.com>
Co-authored-by: Tomohiro Ishibashi <103555868+tomoish@users.noreply.github.com>
msluther added a commit to classdojo/claude-code-action that referenced this pull request Jun 23, 2025
* chore: update claude-code-base-action to v0.0.11

* chore: update claude-code-base-action to v0.0.12

* chore: update claude-code-base-action to v0.0.13

* Update allowed tools align with what is available in github-mcp-server (anthropics#145)

* feat: add max_turns parameter support (anthropics#149)

* feat: add max_turns parameter support

- Add max_turns input to action.yml with proper description
- Pass max_turns parameter through to claude-code-base-action
- Update README with documentation and examples for max_turns usage
- Add comprehensive tests to verify max_turns configuration
- Add yaml dependency for test parsing

Closes anthropics#148

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* chore: remove max-turns test and yaml dependency

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* chore: revert package.json and bun.lock changes

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* Update action.yml

* prettier

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* feat: add roadmap for Claude Code GitHub Action v1.0 (anthropics#150)

Add ROADMAP.md documenting planned features and improvements for reaching v1.0:
- GitHub Action CI results visibility
- Cross-repo support
- Workflow file modification capabilities
- Additional event trigger support
- Configurable commit signing
- Enhanced code review features
- Bot user trigger support
- Customizable base prompts

The roadmap provides transparency on development priorities and invites
community feedback and contributions.

* fix: set disallowed_tools as env when runing prepare.ts (anthropics#151)

* chore: update claude-code-base-action to v0.0.14

* feat: add MultiEdit to base_allowed_tools (anthropics#155)

Add MultiEdit tool to the BASE_ALLOWED_TOOLS array to enable Claude Code to use the MultiEdit tool for making multiple edits to a single file in one operation.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix: add baseUrl to Octokit initialization in update_claude_comment (anthropics#157)

* fix: add baseUrl to Octokit initialization in update_claude_comment

Fixes Bad credentials error on GitHub Enterprise Server by passing
GITHUB_API_URL as baseUrl when initializing Octokit, consistent with
other Octokit instances in the codebase.

Fixes anthropics#156
Related to anthropics#107

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix: pass GITHUB_API_URL as env var to MCP server

Update the MCP server initialization to pass GITHUB_API_URL as an
environment variable, allowing it to work correctly with GitHub
Enterprise Server instances.

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix: import GITHUB_API_URL from config in install-mcp-server

Use the centralized GITHUB_API_URL constant from src/github/api/config.ts instead of reading directly from process.env when passing environment variables to the MCP server. This ensures consistency with how the API URL is handled throughout the codebase.

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* chore: update claude-code-base-action to v0.0.17

* chore: update claude-code-base-action to v0.0.18

* chore: update claude-code-base-action to v0.0.19

* feat: use GitHub display name in Co-authored-by trailers (anthropics#163)

* feat: use GitHub display name in Co-authored-by trailers

- Add name field to GitHubAuthor type
- Update GraphQL queries to fetch user display names
- Add triggerDisplayName to CommonFields type
- Extract display name from fetched GitHub data in prepareContext
- Update Co-authored-by trailer generation to use display name when available

This ensures consistency with GitHub's web interface behavior where
Co-authored-by trailers use the user's display name rather than username.

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix: update GraphQL queries to handle Actor type correctly

The name field is only available on the User subtype of Actor in GitHub's
GraphQL API. This commit updates the queries to use inline fragments
(... on User) to conditionally access the name field when the actor is
a User type.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: clarify Co-authored-by instructions in prompt

Replace interpolated values with clear references to XML tags and add
explicit formatting instructions. This makes it clearer how to use the
GitHub display name when available while maintaining the username for
the email portion.

Changes:
- Use explicit references to <trigger_display_name> and <trigger_username> tags
- Add clear formatting instructions and example
- Explain fallback behavior when display name is not available

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: fetch trigger user display name via dedicated GraphQL query

Instead of trying to extract the display name from existing data (which
was incomplete due to Actor type limitations), we now:

- Add a dedicated USER_QUERY to fetch user display names
- Pass the trigger username to fetchGitHubData
- Fetch the display name during data collection phase
- Simplify prepareContext to use the pre-fetched display name

This ensures we always get the correct display name for Co-authored-by
trailers, regardless of where the trigger came from.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* feat: use dynamic fetch depth based on PR commit count (anthropics#169)

- Replace fixed depth of 20 with dynamic calculation
- Use Math.max(commitCount, 20) to ensure minimum context

* Accept multiline input for allowed_tools and disallowed_tools (anthropics#168)

* docs: add uv example for Python MCP servers in mcp_config section (anthropics#170)

Added documentation showing how to configure Python-based MCP servers using uv
with the --directory argument, as requested in issue anthropics#130.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com>

* feat: add release workflow with beta tag management (anthropics#171)

- Auto-increment patch version for new releases
- Update beta tag to point to latest release
- Update major version tag (v0) for simplified action usage
- Support dry run mode for testing
- Keep beta as the "latest" release channel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>

* chore: update claude-code-base-action to v0.0.20

* update MCP server image to version 0.5.0 (anthropics#175)

* feat: enhance error reporting with specific error types from Claude execution (anthropics#164)

* feat: enhance error reporting with specific error types from Claude execution

- Extract error subtypes (error_during_execution, error_max_turns) from result object
- Display specific error messages in comment header based on error type
- Use total_cost_usd field from SDKResultMessage type
- Prevent showing redundant error details when already displayed in header

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: update claude-code-base-action to v0.0.19

* feat: use GitHub display name in Co-authored-by trailers (anthropics#163)

* feat: use GitHub display name in Co-authored-by trailers

- Add name field to GitHubAuthor type
- Update GraphQL queries to fetch user display names
- Add triggerDisplayName to CommonFields type
- Extract display name from fetched GitHub data in prepareContext
- Update Co-authored-by trailer generation to use display name when available

This ensures consistency with GitHub's web interface behavior where
Co-authored-by trailers use the user's display name rather than username.

Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>

* fix: update GraphQL queries to handle Actor type correctly

The name field is only available on the User subtype of Actor in GitHub's
GraphQL API. This commit updates the queries to use inline fragments
(... on User) to conditionally access the name field when the actor is
a User type.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: clarify Co-authored-by instructions in prompt

Replace interpolated values with clear references to XML tags and add
explicit formatting instructions. This makes it clearer how to use the
GitHub display name when available while maintaining the username for
the email portion.

Changes:
- Use explicit references to <trigger_display_name> and <trigger_username> tags
- Add clear formatting instructions and example
- Explain fallback behavior when display name is not available

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: fetch trigger user display name via dedicated GraphQL query

Instead of trying to extract the display name from existing data (which
was incomplete due to Actor type limitations), we now:

- Add a dedicated USER_QUERY to fetch user display names
- Pass the trigger username to fetchGitHubData
- Fetch the display name during data collection phase
- Simplify prepareContext to use the pre-fetched display name

This ensures we always get the correct display name for Co-authored-by
trailers, regardless of where the trigger came from.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>

* feat: use dynamic fetch depth based on PR commit count (anthropics#169)

- Replace fixed depth of 20 with dynamic calculation
- Use Math.max(commitCount, 20) to ensure minimum context

* Accept multiline input for allowed_tools and disallowed_tools (anthropics#168)

* docs: add uv example for Python MCP servers in mcp_config section (anthropics#170)

Added documentation showing how to configure Python-based MCP servers using uv
with the --directory argument, as requested in issue anthropics#130.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com>

* feat: add release workflow with beta tag management (anthropics#171)

- Auto-increment patch version for new releases
- Update beta tag to point to latest release
- Update major version tag (v0) for simplified action usage
- Support dry run mode for testing
- Keep beta as the "latest" release channel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>

* chore: update claude-code-base-action to v0.0.20

* update MCP server image to version 0.5.0 (anthropics#175)

* refactor: convert error subtype check to switch case

Replace if-else chain with switch statement for better readability
and maintainability when handling error subtypes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
Co-authored-by: Bastian Gutschke <bge@medicuja.com>
Co-authored-by: Hidetake Iwata <int128@gmail.com>
Co-authored-by: Tomohiro Ishibashi <103555868+tomoish@users.noreply.github.com>

* Revert "feat: enhance error reporting with specific error types from Claude e…" (anthropics#179)

This reverts commit 1b94b9e.

* chore: update claude-code-base-action to v0.0.21

* fix: correct assignee trigger test to handle different assignee properly (anthropics#178)

* fix: use direct assignee field

* fix: correct assignee trigger test to handle different assignee properly

The test was failing because the mockIssueAssignedContext was missing the
top-level assignee field that the trigger validation logic checks. Added
the missing assignee field to the mock context and updated the test to
properly override both the top-level assignee and issue.assignee fields
when testing assignment to a different user.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Adjust IssuesAssignedEvent import position (#2)

---------

Co-authored-by: Claude <noreply@anthropic.com>

* chore: update claude-code-base-action to v0.0.22

* docs: remove references to non-existent test-local.sh script (anthropics#187)

All tests for this repo can be run with `bun test` - the test-local.sh script was a holdover from the base action repo.

Fixes anthropics#172

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Ashwin Bhat <ashwin-ant@users.noreply.github.com>

* chore: update claude-code-base-action to v0.0.23

* chore: update claude-code-base-action to v0.0.24

---------

Co-authored-by: GitHub Actions <actions@github.com>
Co-authored-by: Sepehr Sobhani <sepehr411@gmail.com>
Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: ashwin-ant <ashwin-ant@users.noreply.github.com>
Co-authored-by: atsushi-ishibashi <a.ishibashi0501@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Bastian Gutschke <bge@medicuja.com>
Co-authored-by: Hidetake Iwata <int128@gmail.com>
Co-authored-by: Tomohiro Ishibashi <103555868+tomoish@users.noreply.github.com>
Co-authored-by: Kuma Taro <kumagai@bear.tokyo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants