Skip to content

Comments

Update publish-dists.yml#31

Merged
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-1
Jun 1, 2025
Merged

Update publish-dists.yml#31
Dargon789 merged 1 commit intomasterfrom
Dargon789-patch-1

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Jun 1, 2025

Summary by Sourcery

CI:

  • Add prohibited_file to .gitignore and remove it from the Git index in the publish-dists workflow

Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
@codesandbox
Copy link

codesandbox bot commented Jun 1, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@vercel
Copy link

vercel bot commented Jun 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sequence.js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 1, 2025 1:04am

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 1, 2025

Reviewer's Guide

The 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 Workflow

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Added steps to ignore and remove a prohibited file in the publish-dists workflow
  • Append prohibited_file to .gitignore
  • Remove prohibited_file from Git cache
  • Commit the removal with message “Remove prohibited_file”
.github/workflows/publish-dists.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Dargon789 Dargon789 merged commit 3eac9fa into master Jun 1, 2025
15 of 16 checks passed
@Dargon789 Dargon789 deleted the Dargon789-patch-1 branch June 1, 2025 01:06
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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
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.

echo "📦 Publishing $PACKAGE to $BRANCH"

echo "prohibited_file" >> .gitignore
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).


echo "prohibited_file" >> .gitignore
git rm --cached 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant