Files
Eric Rollei 842f640842 Add notifications to publish workflow
- Extract version from pyproject.toml for logging
- Log success message with version number
- Create GitHub issue on failure with details and link to workflow run
2025-12-19 16:53:04 -08:00

58 lines
1.8 KiB
YAML

name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- "pyproject.toml"
permissions:
issues: write
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'EricRollei' }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
- name: Extract version from pyproject.toml
id: version
run: |
VERSION=$(grep -m1 'version = ' pyproject.toml | cut -d'"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Publish Custom Node
id: publish
uses: Comfy-Org/publish-node-action@v1
with:
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
- name: Create success issue comment
if: success()
uses: actions/github-script@v7
with:
script: |
const version = '${{ steps.version.outputs.version }}';
console.log(`✅ Successfully published version ${version} to ComfyUI Registry`);
- name: Notify on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
const version = '${{ steps.version.outputs.version }}';
github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `🚨 Registry publish failed for v${version}`,
body: `The automated publish to ComfyUI Registry failed.\n\n**Version:** ${version}\n**Workflow run:** ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}\n\nPlease check the workflow logs for details.`,
labels: ['bug', 'automation']
});