Skip to content

Conversation

vaind
Copy link
Collaborator

@vaind vaind commented Sep 24, 2025

Summary

Closes #85 by adding a new gh-title-pattern input parameter for filtering releases by GitHub release titles using regex patterns.

Changes

  • ✅ Added gh-title-pattern input parameter to action.yml
  • ✅ Implemented GitHub API integration in update-dependency.ps1 to fetch release metadata
  • ✅ Added filtering logic that works before existing version pattern filtering
  • ✅ Comprehensive test coverage including error handling scenarios
  • ✅ Updated documentation with usage examples and parameter description

Features

  • Filter by release title patterns: Use regex to match specific release naming conventions
  • Release channel support: Target stable releases with patterns like \(Stable\)$
  • GitHub API integration: Uses gh api with pagination for efficient data fetching
  • Robust error handling: Clear error messages when no releases match patterns
  • Backward compatible: Existing workflows continue to work unchanged
  • Flexible and simple: Users define their own regex patterns for any naming convention

Usage Example

# Filter for releases with "(Stable)" suffix
uses: getsentry/github-workflows/updater@v3
with:
  path: modules/sentry-cocoa
  name: Cocoa SDK (Stable)
  gh-title-pattern: '\(Stable\)$'  # Only releases with "(Stable)" suffix
  api-token: ${{ secrets.CI_DEPLOY_KEY }}

Test Results

All tests pass, including:

  • ✅ Filtering by GitHub release title patterns (11 stable releases found from 398 total)
  • ✅ Error handling when no releases match pattern
  • ✅ Backward compatibility without title pattern

Implementation Details

The implementation uses GitHub's REST API to fetch release metadata and filters tags based on release titles before applying the existing version pattern filtering. This ensures the feature works seamlessly with all existing functionality while providing the new release channel filtering capability.

🤖 Generated with Claude Code

Implements Issue #85 by adding a new `gh-title-pattern` input parameter that allows filtering releases by GitHub release titles using regex patterns.

Features:
- Filter releases by title patterns (e.g., '\(Stable\)$' for stable releases)
- Uses GitHub API to fetch release metadata
- Fully backward compatible when parameter is not specified
- Comprehensive test coverage with error handling

Usage example:
```yaml
uses: getsentry/github-workflows/updater@v3
with:
  path: modules/sentry-cocoa
  name: Cocoa SDK (Stable)
  gh-title-pattern: '\(Stable\)$'
```

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

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

github-actions bot commented Sep 24, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 3275e8c

vaind and others added 5 commits September 24, 2025 07:52
The --paginate flag returns separate pages, not combined results.
Using the default API call (first 30 releases) is sufficient for most
repositories when filtering by release title patterns.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Simplify the implementation with:
- Consolidated URL validation with single regex match
- Cleaner variable assignment using tuple unpacking
- Simplified array handling by wrapping API result in @()
- Removed unnecessary null/single object checks
- More concise comments and clearer logic flow

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add test that matches exact release version (2.11.1) by title pattern
- This provides a deterministic test case that verifies exact behavior
- Fix error handling to ensure proper error message when no releases match
- All 4 gh-title-pattern tests now pass

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

Co-Authored-By: Claude <noreply@anthropic.com>
@vaind vaind changed the title feat: Add gh-title-pattern input for release channel filtering feat: Support GitHub release title pattern matching Sep 24, 2025
vaind and others added 5 commits September 24, 2025 08:20
Documents the new gh-title-pattern feature that allows users to filter
releases by their GitHub release titles using regex patterns.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Ensures that gh api commands work properly in CI environments
by setting the GH_TOKEN environment variable to the provided
api-token input.

This fixes the issue where GitHub release title filtering
would fail silently in CI due to lack of authentication.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@vaind
Copy link
Collaborator Author

vaind commented Sep 24, 2025

@sentry review

@vaind vaind marked this pull request as ready for review September 24, 2025 07:14
@vaind vaind merged commit de9e3fa into main Sep 24, 2025
16 checks passed
@vaind vaind deleted the feat/support-release-channels branch September 24, 2025 09:11
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.

Updater: support release channels

1 participant