-
Notifications
You must be signed in to change notification settings - Fork 378
refactor: reorganize GitHub workflows with consistent naming convention #5891
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
snomiao
wants to merge
4
commits into
main
Choose a base branch
from
sno-tidy-workflows
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b578a42
refactor: reorganize GitHub workflows with consistent naming convention
snomiao 676792c
Update .github/workflows/README.md
snomiao 7006800
rename workflow to 'CI - JSON Validation' to match filename convention
snomiao 2fcb840
[docs] add link to GitHub workflow trigger documentation
snomiao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# GitHub Workflows Documentation | ||
|
||
## Naming Convention | ||
|
||
All workflow files follow a consistent naming pattern for improved organization and discoverability. | ||
|
||
### File Naming Format | ||
|
||
``` | ||
<prefix>-<descriptive-name>.yaml | ||
``` | ||
|
||
**Rules:** | ||
1. Use `.yaml` extension consistently (not `.yml`) | ||
2. Use lowercase letters only | ||
3. Use hyphens (`-`) as word separators | ||
4. Start with a category prefix (see below) | ||
5. Follow prefix with a descriptive name that clearly indicates the workflow's purpose | ||
|
||
### Category Prefixes | ||
|
||
| Prefix | Category | Purpose | Example | | ||
|--------|----------|---------|---------| | ||
| `ci-` | Continuous Integration | Testing, linting, validation workflows | `ci-tests-e2e.yaml` | | ||
| `release-` | Release Management | Version bumps, release branches, release drafts | `release-version-bump.yaml` | | ||
| `ci-` | Continuous Integration | Testing, linting, validation workflows | `ci-tests-e2e.yaml` | | ||
| `release-` | Release Management | Version bumps, release branches, release drafts | `release-version-bump.yaml` | | ||
| `pr-` | PR Automation | PR-specific workflows triggered by labels or comments | `pr-claude-review.yaml` | | ||
| `types-` | Type Generation | TypeScript type generation and updates | `types-registry-api.yaml` | | ||
| `i18n-` | Internationalization | Locale and translation updates | `i18n-update-core.yaml` | | ||
|
||
## Workflow Organization | ||
|
||
### Test Workflows (`ci-tests-*`) | ||
- `ci-tests-e2e.yaml` - End-to-end testing with Playwright | ||
- `ci-tests-unit.yaml` - Unit and component testing with Vitest | ||
- `ci-tests-storybook.yaml` - Storybook build and visual regression testing | ||
- `ci-tests-*-forks.yaml` - Fork-safe deployment workflows (deploy results without exposing secrets) | ||
|
||
### PR Label Workflows (`pr-*`) | ||
These workflows are triggered when specific labels are added to PRs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be a good place to link to GitHub's documentation. |
||
|
||
| Workflow | Trigger Label | Purpose | | ||
|----------|---------------|---------| | ||
| `pr-backport.yaml` | `needs-backport` | Cherry-pick PRs to release branches | | ||
| `pr-claude-review.yaml` | `claude-review` | AI-powered code review | | ||
| `pr-playwright-snapshots.yaml` | `New Browser Test Expectations` | Update visual test snapshots | | ||
snomiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Workflow Triggers | ||
|
||
For more details on workflow triggers, see [GitHub's workflow trigger documentation](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows). | ||
|
||
### Common Trigger Patterns | ||
|
||
| Trigger Type | Use Case | Example | | ||
|--------------|----------|---------| | ||
| `push` to main/master | Production CI/CD | Deploy to production | | ||
| `pull_request` | PR validation | Run tests, linting | | ||
| `workflow_dispatch` | Manual execution | On-demand deployments | | ||
| `repository_dispatch` | External triggers | API type updates | | ||
| `workflow_run` | Chain workflows | Fork deployments | | ||
| `schedule` | Periodic tasks | Nightly builds | | ||
| Label added | Conditional actions | Review requests, snapshots | | ||
|
||
### Branch Protection Patterns | ||
|
||
- **Main branches**: `main`, `master` | ||
- **Release branches**: `core/**`, `release/**` | ||
- **Development branches**: `dev/**`, `develop/**` | ||
- **Desktop branches**: `desktop/**` | ||
- **WIP exclusion**: `!**wip/**`, `!wip/**` | ||
|
||
## Best Practices | ||
snomiao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
1. **Consistency**: Always use the naming convention for new workflows | ||
2. **Documentation**: Update this README when adding new prefixes or patterns | ||
3. **Permissions**: Use minimal required permissions for security | ||
4. **Caching**: Leverage GitHub Actions cache for dependencies and build artifacts | ||
5. **Concurrency**: Use concurrency groups to prevent duplicate runs | ||
6. **Secrets**: Never hardcode secrets; use GitHub Secrets | ||
7. **Fork Support**: Consider fork limitations when designing workflows | ||
8. **Error Handling**: Include proper error handling and status checks | ||
9. **Reusability**: Use workflow_call for shared logic across workflows | ||
|
||
## External Dependencies | ||
|
||
- **Cloudflare Pages**: Deployment platform for previews and test reports | ||
- **Chromatic**: Visual regression testing for Storybook | ||
- **OpenAI API**: Translation generation for i18n workflows | ||
- **PyPI**: Python package distribution | ||
- **npm Registry**: TypeScript types distribution | ||
- **Claude API**: AI code review |
2 changes: 1 addition & 1 deletion
2
.github/workflows/validate-json.yaml → .github/workflows/ci-json-validation.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Validate JSON | ||
name: CI - JSON Validation | ||
|
||
on: | ||
push: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/lint-and-format.yaml → .github/workflows/ci-lint-format.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Lint and Format | ||
name: Lint Format CI | ||
|
||
on: | ||
pull_request: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/devtools-python-check.yaml → .github/workflows/ci-python-validation.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Devtools Python Check | ||
name: Python Validation CI | ||
|
||
on: | ||
pull_request: | ||
|
6 changes: 4 additions & 2 deletions
6
...workflows/pr-playwright-deploy-forks.yaml → .github/workflows/ci-tests-e2e-forks.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.github/workflows/tests-ci.yaml → .github/workflows/ci-tests-e2e.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Tests CI | ||
name: Tests E2E CI | ||
|
||
on: | ||
push: | ||
|
6 changes: 4 additions & 2 deletions
6
.../workflows/pr-storybook-deploy-forks.yaml → ...b/workflows/ci-tests-storybook-forks.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...workflows/storybook-and-chromatic-ci.yaml → .github/workflows/ci-tests-storybook.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.github/workflows/vitest-tests.yaml → .github/workflows/ci-tests-unit.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Vitest Tests | ||
name: Tests Unit CI | ||
|
||
on: | ||
push: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/update-locales.yaml → .github/workflows/i18n-update-core.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update Locales | ||
name: i18n Update Core | ||
|
||
on: | ||
# Manual dispatch for urgent translation updates | ||
|
2 changes: 1 addition & 1 deletion
2
...les-for-given-custom-node-repository.yaml → ...b/workflows/i18n-update-custom-nodes.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update Locales for given custom node repository | ||
name: i18n Update Custom Nodes | ||
|
||
on: | ||
workflow_dispatch: | ||
|
2 changes: 1 addition & 1 deletion
2
...lows/update-node-definitions-locales.yaml → .github/workflows/i18n-update-nodes.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update Node Definitions Locales | ||
name: i18n Update Nodes | ||
|
||
on: | ||
workflow_dispatch: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/auto-backport.yaml → .github/workflows/pr-backport.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Auto Backport | ||
name: PR Backport | ||
|
||
on: | ||
pull_request_target: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/claude-pr-review.yml → .github/workflows/pr-claude-review.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Claude PR Review | ||
name: PR Claude Review | ||
|
||
permissions: | ||
contents: read | ||
|
2 changes: 1 addition & 1 deletion
2
...flows/update-playwright-expectations.yaml → ...ub/workflows/pr-playwright-snapshots.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.github/workflows/create-release-branch.yaml → .github/workflows/release-branch-create.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Create Release Branch | ||
name: Release Branch Create | ||
|
||
on: | ||
pull_request: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...hub/workflows/publish-frontend-types.yaml → .github/workflows/release-npm-types.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish Frontend Types | ||
name: Release NPM Types | ||
|
||
on: | ||
workflow_dispatch: | ||
|
2 changes: 1 addition & 1 deletion
2
...ub/workflows/create-dev-pypi-package.yaml → .github/workflows/release-pypi-dev.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Create Dev PyPI Package | ||
name: Release PyPI Dev | ||
|
||
on: | ||
workflow_dispatch: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/version-bump.yaml → .github/workflows/release-version-bump.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Version Bump | ||
name: Release Version Bump | ||
|
||
on: | ||
workflow_dispatch: | ||
|
2 changes: 1 addition & 1 deletion
2
.github/workflows/update-electron-types.yaml → .github/workflows/types-electron-api.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update Electron Types | ||
name: Types Electron API | ||
|
||
on: | ||
workflow_dispatch: | ||
|
2 changes: 1 addition & 1 deletion
2
...ows/update-comfyui-manager-api-types.yaml → .github/workflows/types-manager-api.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update ComfyUI-Manager API Types | ||
name: Types Manager API | ||
|
||
on: | ||
# Manual trigger | ||
|
2 changes: 1 addition & 1 deletion
2
...lows/update-comfy-registry-api-types.yaml → .github/workflows/types-registry-api.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Update Comfy Registry API Types | ||
name: Types Registry API | ||
|
||
on: | ||
# Manual trigger | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of documentation can get out of date really quickly.
Can we put comments into the workflows themselves, then have a single
e.g.
here?