Skip to content

Update Github Action for Publishing to Comfy Registry #48

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robinjhuang
Copy link

@robinjhuang robinjhuang commented Apr 3, 2025

Hey! My name is Robin and I'm from comfy-org! We would love to have you join the Comfy Registry, a public collection of custom nodes which lets authors publish nodes by version and automate testing against existing workflows. This PR updates the Github Action publish_action.yml to ensure the latest ComfyUI Community Standard.

Updates:

  1. Issue Creating Permission: Ensures that the workflow can open issues to report publishing states or warnings, facilitating better communication and issue tracking.
+ # auto issue permission, for Comfy CustomNode registry publishing state
+ permissions:
+   issues: write
  1. Conditional Execution: Only runs the publish job in the author’s repo, defaults to repo owner.
+     if: ${{ github.repository_owner == 'pollockjj' }}
  1. Versioning: We use an explicit version number after a stable release. Using a stable release version of the action reduces the risk of unexpected behavior from changes in the action's main branch.
-     uses: Comfy-Org/publish-node-action@~~main~~
+     uses: Comfy-Org/publish-node-action@v1

Learn More

Please message me on Discord at robin or join our server if you have any questions! For more information, visit the official Comfy-Org blog: ComfyUI Blog.

Summary by Sourcery

Update GitHub Action workflow for publishing to Comfy Registry with improved configuration and security

Enhancements:

  • Improve workflow security by pinning to a specific action version instead of using main branch
  • Add conditional execution to prevent unintended publishing

CI:

  • Update publish action to use a stable version of the Comfy-Org publishing action
  • Add repository owner validation to ensure publish job runs only in the intended repository
  • Grant workflow permission to create issues for publishing state tracking

- Add permissions for issue writing
- Restrict job execution to specific repository owner
- Update action version to v1 for stability
- Ensure proper token usage for registry access
Copy link

sourcery-ai bot commented Apr 3, 2025

Reviewer's Guide by Sourcery

This pull request updates the Github Action publish_action.yml to improve its functionality and ensure compatibility with the ComfyUI Community Standard. The changes include requesting issue creation permissions, adding a conditional check for job execution, and using a specific version of the publish-node-action.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Configured the workflow to request write permissions for issues.
  • Added permissions key to the workflow configuration.
  • Set issues permission to write.
.github/workflows/publish_action.yml
Added a conditional check to ensure the publish job only runs in the author's repository.
  • Added an if condition to the publish-node job.
  • The condition checks if github.repository_owner is equal to pollockjj.
.github/workflows/publish_action.yml
Updated the publish-node-action to use a specific version tag.
  • Changed the uses value for the Publish Custom Node step.
  • Updated the action version from main to v1.
.github/workflows/publish_action.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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

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 @robinjhuang - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using github.repository instead of github.repository_owner to avoid hardcoding the repository owner.
  • It might be better to use GITHUB_TOKEN instead of requiring users to create and manage a REGISTRY_ACCESS_TOKEN.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 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.

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.

2 participants