-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix(tools): allow release branches to trigger release #348
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes involve an update to the GitHub Actions workflow configuration file Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant CI/CD
Developer->>GitHub: Push to release/*
GitHub->>CI/CD: Trigger release workflow
CI/CD->>GitHub: Execute release process
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
4778194
to
cee28f0
Compare
cee28f0
to
71771f7
Compare
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.github/workflows/release.yml (1)
11-11
: Consider adding release branch cleanupAfter a successful release, the release branch typically becomes obsolete. Consider adding a cleanup step to delete the branch after successful release.
Add this step after the release:
- name: Delete release branch if: startsWith(github.ref, 'refs/heads/release/') run: | git push origin --delete ${GITHUB_REF#refs/heads/} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/release.yml
(1 hunks)
🔇 Additional comments (2)
.github/workflows/release.yml (2)
Line range hint 1-39
: Verify semantic-release configuration for release/ branches*
The workflow uses semantic-release which determines version numbers based on branch names. We should verify that the semantic-release configuration properly handles release/*
branches to prevent version conflicts.
#!/bin/bash
# Description: Check semantic-release configuration
# Expected: Should show configuration that handles release/* branches
# Look for release.config.js or semantic-release configuration in package.json
fd -e js -e json -E node_modules -x cat {} \; | rg -A 10 'release\.config|semantic-release'
Consider documenting the following in your README or CONTRIBUTING guide:
- The naming convention for release branches (e.g.,
release/1.0.0-beta
) - How semantic-release determines versions from these branches
- The release workflow and when to use release branches vs. other branches
11-11
: Verify branch protection rules for release/ pattern*
While adding support for release branches is valuable for flexible release management, it's crucial to ensure proper branch protection rules are in place to prevent unauthorized releases.
✅ Verification successful
No release/ branches found; branch protection rules are not applicable.*
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check branch protection rules for release/* pattern
# Expected: Should show branch protection rules that include release/* pattern
# Check branch protection rules
gh api repos/deepgram/deepgram-js-sdk/branches/release/protection 2>/dev/null || echo "No branch protection rule found for release/* pattern"
# List existing protected branches for reference
gh api repos/deepgram/deepgram-js-sdk/branches?protected=true
Length of output: 1443
Script:
#!/bin/bash
# Description: Check branch protection rules for all release/* branches
# Expected: Should list all release/* branches and indicate if they have protection rules
# Get all branches matching release/*
branches=$(gh api repos/deepgram/deepgram-js-sdk/branches | jq -r '.[] | select(.name | startswith("release/")) | .name')
if [ -z "$branches" ]; then
echo "No branches match the release/* pattern."
exit 0
fi
# Iterate over each release/* branch and check protection
for branch in $branches; do
echo "Checking protection for branch: $branch"
protection=$(gh api repos/deepgram/deepgram-js-sdk/branches/$branch/protection 2>/dev/null)
if [ -z "$protection" ]; then
echo "No branch protection rule found for $branch"
else
echo "Branch protection is enabled for $branch"
fi
done
Length of output: 241
This gives us the ability to cut alpha/beta/custom releases via a
release/
branch.Summary by CodeRabbit
release/*
naming convention.