-
Notifications
You must be signed in to change notification settings - Fork 0
ci: fix repository of platform npm #3
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
Conversation
WalkthroughThe changes update the CI workflow and package configuration files. In the CI workflow, the publish step now triggers only when the commit message begins with "Release" followed by a version number instead of matching any semantic version format. Additionally, the Changes
Sequence Diagram(s)sequenceDiagram
participant C as Commit Message
participant CI as CI Workflow
participant P as Publish Step
participant F as Fallback Tagging
C->>CI: Push commit
CI->>CI: Evaluate commit message pattern
alt Message starts with "Release <version>"
CI->>P: Execute publish step
else
CI->>F: Trigger fallback tagging
end
Poem
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 (
|
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
🧹 Nitpick comments (1)
.github/workflows/CI.yml (1)
192-196: Enhance CI Publish Step for Clarity and Efficiency
The updated regex conditions now correctly require commit messages to begin with"Release "followed by a valid version. To simplify the script and avoid invokinggit logtwice, consider caching the commit message in a variable and usinggrep -Efor extended regex. This change would improve both readability and performance.Proposed diff snippet:
- if git log -1 --pretty=%B | grep "^Release [0-9]\+\.[0-9]\+\.[0-9]\+$"; - then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --access public - elif git log -1 --pretty=%B | grep "^Release [0-9]\+\.[0-9]\+\.[0-9]\+"; - then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --tag next --access public - else - echo "Not a release, skipping publish" - fi + commit_msg=$(git log -1 --pretty=%B) + if echo "$commit_msg" | grep -qE "^Release [0-9]+\.[0-9]+\.[0-9]+$"; + then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --access public + elif echo "$commit_msg" | grep -qE "^Release [0-9]+\.[0-9]+\.[0-9]+"; + then + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc + npm publish --tag next --access public + else + echo "Not a release, skipping publish" + fi
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/CI.yml(1 hunks)npm/darwin-arm64/package.json(1 hunks)npm/darwin-universal/package.json(1 hunks)npm/darwin-x64/package.json(1 hunks)npm/linux-x64-gnu/package.json(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- npm/darwin-universal/package.json
- npm/darwin-x64/package.json
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Test bindings on macos - node@22
- GitHub Check: Test bindings on macos - node@20
🔇 Additional comments (2)
npm/darwin-arm64/package.json (1)
11-14: Repository Field Addition is Correct
The new"repository"field with the nested"url"and"directory"properties is correctly added and follows the desired metadata structure. If your downstream tooling requires an explicit"type"(commonly"git"), consider adding it to further standardize the configuration.npm/linux-x64-gnu/package.json (1)
14-17: Repository Field Inclusion is Valid
The"repository"field has been appropriately added with the correct"url"and"directory"properties for this package. This change is consistent with similar updates in other packages. Optionally, if your ecosystem or CI tools expect a"type"property (e.g.,"git"), you might consider including it.
|
👋 |
Summary by CodeRabbit