-
Notifications
You must be signed in to change notification settings - Fork 1
Update publish-dists.yml #31
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,9 @@ jobs: | |
| PKG_DIR="packages/$PACKAGE" | ||
|
|
||
| echo "📦 Publishing $PACKAGE to $BRANCH" | ||
|
|
||
| echo "prohibited_file" >> .gitignore | ||
| git rm --cached prohibited_file | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Avoid using git rm in CI for packaging Instead of modifying the repo state, delete the unwanted file directly from the package directory before publishing (e.g., |
||
| git commit -m "Remove prohibited_file" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Committing in CI will likely fail and won’t push CI workflows usually run in a detached HEAD without git user config, and there's no push step, so this commit will fail or do nothing. Filter out unwanted files from the build artifact instead. |
||
| mkdir -p /tmp/$PACKAGE | ||
| shopt -s dotglob | ||
| cp -r $PKG_DIR/* /tmp/$PACKAGE || true | ||
|
|
||
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.
suggestion: Don’t modify .gitignore in CI
To exclude files from the published package, use .npmignore or the "files" field in package.json rather than modifying .gitignore during CI.
Suggested implementation:
To fully implement the suggestion, ensure that
prohibited_fileis excluded from the published package by adding it to.npmignoreor by configuring thefilesfield inpackage.jsonin the relevant package directory. No further changes are needed in the CI workflow.