Conversation
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's GuideThe GitHub Actions ‘publish-dists.yml’ workflow has been enhanced to automatically exclude a prohibited file from packaging by adding it to .gitignore, removing it from the Git index, and committing the removal before assembling the distribution. Sequence Diagram: Handling of Prohibited Files in Publish WorkflowsequenceDiagram
participant Job as "Publish Dist Job"
participant GitRepo as "Git Repository"
participant Filesystem
Job->>GitRepo: Modify .gitignore (add "prohibited_file")
Job->>GitRepo: Remove "prohibited_file" from Git index (git rm --cached)
Job->>GitRepo: Commit changes to repository (updated .gitignore, "prohibited_file" no longer tracked)
Job->>Filesystem: Create temporary directory for package
Job->>Filesystem: Copy package source files to temporary directory
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Dargon789 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| echo "📦 Publishing $PACKAGE to $BRANCH" | ||
|
|
||
| echo "prohibited_file" >> .gitignore |
There was a problem hiding this comment.
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:
echo "📦 Publishing $PACKAGE to $BRANCH"
mkdir -p /tmp/$PACKAGE
shopt -s dotglob
cp -r $PKG_DIR/* /tmp/$PACKAGE || true
To fully implement the suggestion, ensure that prohibited_file is excluded from the published package by adding it to .npmignore or by configuring the files field in package.json in the relevant package directory. No further changes are needed in the CI workflow.
| echo "📦 Publishing $PACKAGE to $BRANCH" | ||
|
|
||
| echo "prohibited_file" >> .gitignore | ||
| git rm --cached prohibited_file |
There was a problem hiding this comment.
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., rm /tmp/$PACKAGE/prohibited_file).
|
|
||
| echo "prohibited_file" >> .gitignore | ||
| git rm --cached prohibited_file | ||
| git commit -m "Remove prohibited_file" |
There was a problem hiding this comment.
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.
Summary by Sourcery
CI: