-
Notifications
You must be signed in to change notification settings - Fork 9
feat: updated the workflow and if release needed #65
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 aim to fix and improve the GitHub workflow for publishing packages to NPM. Key updates include rearranging workflow steps, adding a script to set file permissions, configuring Changes
Sequence Diagram(s)No sequence diagrams are necessary for these changes as they involve straightforward modifications to workflow logic and script updates. Assessment against linked issues
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 4
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
Files selected for processing (4)
- .github/workflows/npm-publish.yaml (1 hunks)
- package.json (1 hunks)
- packages/shared/package.json (1 hunks)
- scripts/is-release-needed.sh (1 hunks)
Additional comments not posted (3)
packages/shared/package.json (1)
10-11: LGTM!The addition of the
is-release-neededscript is appropriate..github/workflows/npm-publish.yaml (2)
31-32: Clarify the purpose of making the script executable.Ensure that the script needs to be made executable within the workflow.
47-49: Fix the condition for the publish step.Ensure that the condition for the publish step checks the correct output variable.
- if: ${{ steps.is-release-needed.outputs.is-release-needed-${{ matrix.package }} == 'true' }} + if: ${{ steps.is-release-needed.outputs.is-release-needed-${{ matrix.package }} == '0' }}Likely invalid or redundant comment.
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (1)
- .github/workflows/npm-publish.yaml (1 hunks)
Additional comments not posted (4)
.github/workflows/npm-publish.yaml (4)
31-32: LGTM!Making the
is-release-needed.shscript executable is necessary for it to run.
34-39: LGTM!Printing package information is useful for debugging purposes.
47-48: LGTM!Setting up the
.npmrcfile is necessary for authentication to publish to npm.
40-45: Fix the usage ofechofor output.Use
$GITHUB_OUTPUTto set the output variable properly.- echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUT + echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_ENVLikely invalid or redundant comment.
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
Files selected for processing (1)
- .github/workflows/npm-publish.yaml (1 hunks)
Additional comments not posted (6)
.github/workflows/npm-publish.yaml (6)
19-21: LGTM!The step to checkout the repository is correctly implemented.
22-27: LGTM!The step to set up Node.js environment is correctly implemented.
28-30: LGTM!The step to install dependencies using
npm ciis correctly implemented.
31-33: LGTM!The step to make the
is-release-needed.shscript executable is correctly implemented.
41-43: LGTM!The step to set up the
.npmrcfile for npm authentication is correctly implemented.
44-48: Uncomment thenpm publishcommand.The
npm publishcommand is commented out, which will prevent the package from being published.- # npm publish --workspace=${{ matrix.package }} + npm publish --workspace=${{ matrix.package }}Likely invalid or redundant comment.
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: 2
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- .github/workflows/npm-publish.yaml (1 hunks)
- scripts/is-release-needed.sh (1 hunks)
Additional comments not posted (7)
scripts/is-release-needed.sh (1)
14-15: Add explanatory message before exiting.Adding a message before exiting improves clarity.
- exit 0 # release needed + echo "Release needed for $PACKAGE_NAME@$PACKAGE_VERSION" + exit 0Likely invalid or redundant comment.
.github/workflows/npm-publish.yaml (6)
19-21: LGTM!The repository checkout step is correctly implemented.
22-27: LGTM!The Node.js setup step is correctly implemented.
31-33: LGTM!The step to make the script executable is correctly implemented.
42-43: Ensure proper authentication setup.The step to set up the
.npmrcfile is necessary for authentication.
45-49: Uncomment thenpm publishcommand.The
npm publishcommand is commented out, which will prevent the package from being published.- # npm publish --workspace=${{ matrix.package }} + npm publish --workspace=${{ matrix.package }}Likely invalid or redundant comment.
34-41: Fix the usage ofechofor output.Use
$GITHUB_OUTPUTto set the output variable properly.- run: echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUT + run: echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUTLikely invalid or redundant comment.
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (1)
- .github/workflows/npm-publish.yaml (1 hunks)
Additional comments not posted (4)
.github/workflows/npm-publish.yaml (4)
28-29: LGTM!The step to install dependencies using
npm ciis correct and necessary for the workflow.
31-32: LGTM!The step to make the
is-release-needed.shscript executable is correct and necessary.
42-43: LGTM!The step to set up the
.npmrcfile with the npm token is correct and necessary for authentication.
45-49: Uncomment thenpm publishcommand.The
npm publishcommand is commented out, which will prevent the package from being published.- # npm publish --workspace=${{ matrix.package }} + npm publish --workspace=${{ matrix.package }}Likely invalid or redundant comment.
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
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (2)
- .github/workflows/npm-publish.yaml (1 hunks)
- scripts/is-release-needed.sh (1 hunks)
Additional comments not posted (4)
scripts/is-release-needed.sh (1)
10-12: Use exit codes instead ofecho.Using exit codes (
exit 0for success andexit 1for failure) makes the script logic clearer and more conventional.- echo 'true' # release needed + echo "Release needed for $PACKAGE_NAME@$PACKAGE_VERSION" + exit 0 - echo 'false' # release not needed + echo "Release not needed for $PACKAGE_NAME@$PACKAGE_VERSION" + exit 1.github/workflows/npm-publish.yaml (3)
38-40: Fix the usage ofechofor output.Use
$GITHUB_OUTPUTto set the output variable properly and remove the redundant command.- echo "is-release-needed=$IS_RELEASE_NEEDED" - echo "is-release-needed=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUT + echo "is-release-needed=${{ matrix.package }}=$IS_RELEASE_NEEDED" >> $GITHUB_OUTPUT
42-44: Fix the condition for setting up.npmrc.Ensure the condition checks the correct output variable.
- if: steps.is-release-needed.outputs.is-release-needed == 'true' + if: steps.is-release-needed.outputs["is-release-needed-${{ matrix.package }}"] == 'true'
47-49: Fix the condition for publishing the package.Ensure the condition checks the correct output variable.
- if: steps.is-release-needed.outputs.is-release-needed == 'true' + if: steps.is-release-needed.outputs["is-release-needed-${{ matrix.package }}"] == 'true'
Fixes #29
npm-publishworkflowSummary by CodeRabbit