Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/publish-dists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
PKG_DIR="packages/$PACKAGE"

echo "📦 Publishing $PACKAGE to $BRANCH"

echo "prohibited_file" >> .gitignore
Copy link

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:

            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.

git rm --cached prohibited_file
Copy link

Choose a reason for hiding this comment

The 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., rm /tmp/$PACKAGE/prohibited_file).

git commit -m "Remove prohibited_file"
Copy link

Choose a reason for hiding this comment

The 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
Expand Down