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
This commit is contained in:
@@ -21,8 +21,37 @@ jobs:
|
||||
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:
|
||||
## Add your own personal access token to your Github Repository secrets and reference it here.
|
||||
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']
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user