[Build-Netlify] update netlify.toml file to build feature branch PRs#5860
[Build-Netlify] update netlify.toml file to build feature branch PRs#5860Sulaymon333 wants to merge 1 commit intomasterfrom
Conversation
|
✅ Deploy Preview for hpe-theme-preview canceled.
|
✅ Deploy Preview for hpe-design-icons-grommet canceled.
|
✅ Deploy Preview for unrivaled-bublanina-3a9bae canceled.
|
| @@ -1,2 +1,14 @@ | |||
| [build.environment] | |||
| YARN_FLAGS = "--update-checksums" No newline at end of file | |||
There was a problem hiding this comment.
I removed this line since we have moved away from yarn and now run pnpm as our package manager
There was a problem hiding this comment.
Pull request overview
This pull request aims to configure Netlify build behavior for deploy previews by adding a build ignore script to netlify.toml. The PR description indicates it should enable deploy previews for feature branches starting with "wip-*", but the implementation has critical logic issues.
Changes:
- Adds a build ignore script to control when Netlify generates deploy previews based on branch names and build context
- Removes the previous
build.environmentconfiguration containing YARN_FLAGS
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case "$BRANCH" in | ||
| wip-*) exit 1 ;; | ||
| *) exit 0 ;; | ||
| esac |
There was a problem hiding this comment.
The logic appears to be inverted from what the PR description states. According to the PR description, this change should "add deploy preview for feature branches starting with wip-". However, the current logic skips builds (exit 1) for branches matching "wip-" pattern, which means deploy previews will NOT be generated for these branches. If the intent is to enable deploy previews for wip-* branches, the case statement should be: wip-*) exit 0 ;; *) exit 1 ;; instead.
| esac | ||
| fi | ||
| exit 1 | ||
| ''' No newline at end of file |
There was a problem hiding this comment.
The previous build.environment configuration with YARN_FLAGS has been completely removed without explanation. If this was intentional, consider documenting why this configuration is no longer needed. If the YARN_FLAGS setting is still required, it should be preserved alongside the new ignore configuration.
| ''' | |
| ''' | |
| # Note: A previous [build.environment] configuration with YARN_FLAGS was intentionally removed. | |
| # The build no longer relies on custom Yarn flags, so the YARN_FLAGS setting is not required here. |
| *) exit 0 ;; | ||
| esac | ||
| fi | ||
| exit 1 |
There was a problem hiding this comment.
The final exit 1 at line 13 will execute for all contexts other than deploy-preview, which means builds will be skipped for production deployments and branch deployments. If the intent is to only control deploy-preview builds and allow other build contexts to proceed normally, this line should be exit 0 instead, or the entire if block should not have a fallthrough exit statement.
| exit 1 | |
| exit 0 |
There was a problem hiding this comment.
this comment is wrong based on Netlify documentation on ignore exit code
Deploy Preview
What does this PR do?
What are the relevant issues?
Where should the reviewer start?
How should this be manually tested?
Any background context you want to provide?
Screenshots (if appropriate)
Should this PR be mentioned in Design System updates?
Is this change backwards compatible or is it a breaking change?