-
-
Notifications
You must be signed in to change notification settings - Fork 165
Fix: Run pkg.pr.new only if there are changes #656
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
@chbg is attempting to deploy a commit to the 47ng Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thanks! That issue was initially intended for Hacktoberfest, but there's no harm in getting it done early.
A couple of changes are needed:
exit 0
doesn't actually skip rest of the steps in the workflow- Only the last commit in the PR is checked for changes
Modified the check for changes to the nuqs package by adding an output variable skip=true when no changes are detected. This allows the workflow to continue without failing while enabling subsequent steps to conditionally execute based on this output. Additionally, adjusted the Git diff command to evaluate the entire commit range from base to HEAD, ensuring a more comprehensive check for any changes. Co-authored-by: François Best <github@francoisbest.com>
Implemented a condition for the ‘Publish to pkg.pr.new’ step to execute only if changes were detected in the nuqs package. By adding if: steps.check-for-changes.outputs.skip != 'true', the workflow prevents unnecessary publishing actions when there are no changes, optimizing the deployment process and reducing potential errors. Co-authored-by: François Best <github@francoisbest.com>
This commit adds a newline between the 'Install dependencies' step and the 'Publish to pkg.pr.new' step in the workflow file to improve readability and maintainability of the code.
Co-authored-by: François Best <github@francoisbest.com>
Co-authored-by: François Best <github@francoisbest.com>
Co-authored-by: François Best <github@francoisbest.com>
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.
Thanks! Let's see if it works now.
Thanks for your guidance and patience. I really appreciate it. |
Co-authored-by: François Best <github@francoisbest.com>
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.
Let's give it another try.
It worked! Thanks for your patience too, TIL a few more things about Git and GHA 😄 |
We did it! Onto the next one... 🤝 |
Well if you feel like it, we could optimise this even more by splitting the workflow into two jobs:
That saves setting up dependencies and building the package if we're not going to do anything with it. |
I feel like it! Want me to just submit another PR when I'm done or do you want to create an issue and assign it to me? |
Go for it, no need for an issue (maybe refer to the original #655 one for reference). |
🎉 This PR is included in version 1.20.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Added a conditional check in pkg.pr.new.yml to prevent unnecessary runs when no changes are detected in the nuqs package.
Closes #655.