Add canvas extension PR labeling and validation workflow#2017
Merged
Conversation
- Update PR template to include canvas extension as a contribution type - Add 'canvas-extension' label (color: E4B9FF) to label-pr-intent workflow with auto-detection for PRs touching extensions/** - Add new validate-canvas-extensions.yml workflow that checks: - extension.mjs is present in each changed extension folder - assets/preview.png screenshot is present in each changed extension folder - Posts a REQUEST_CHANGES review with a fix guide on failure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds guardrails for canvas extension submissions by introducing automated validation and PR intent labeling updates, plus a small PR template refresh to reflect canvas extensions as a contribution type.
Changes:
- Introduces a new GitHub Actions workflow to validate required canvas extension files (
extension.mjs,assets/preview.png) for PRs touchingextensions/**. - Extends PR intent auto-labeling to apply a new
canvas-extensionlabel when files underextensions/<name>/...change. - Updates the PR template checklist and contribution-type options to include canvas extensions.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/validate-canvas-extensions.yml | New PR-time validator for required canvas extension structure and preview asset. |
| .github/workflows/label-pr-intent.yml | Adds canvas-extension managed label and detection patterns for extensions/ changes. |
| .github/pull_request_template.md | Expands checklist/type options to include canvas extensions. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 3
Comment on lines
+42
to
+46
| if (parts[0] === EXTENSIONS_DIR && parts.length >= 2) { | ||
| const extName = parts[1]; | ||
| // Skip the external-assets directory — it's not a canvas extension | ||
| if (extName !== EXTERNAL_ASSETS_DIR) { | ||
| changedExtDirs.add(path.join(EXTENSIONS_DIR, extName)); |
Comment on lines
+67
to
+68
| const extName = path.basename(extDir); | ||
|
|
Comment on lines
+118
to
+122
| await github.rest.pulls.createReview({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: context.issue.number, | ||
| event: 'REQUEST_CHANGES', |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.stagedbranch for this pull request.Description
This adds baseline guardrails for canvas extension submissions so reviewers get consistent structure and preview assets, and so canvas PRs can be identified automatically.
The change updates the PR template to include canvas extensions as a contribution type, extends PR intent labeling with a new
canvas-extensionlabel forextensions/**changes, and adds a dedicated validation workflow for extension submissions. The new workflow checks each changed extension directory forextension.mjsandassets/preview.png(the screenshot convention introduced in #1987), then fails with actionable review guidance when requirements are missing.Type of Contribution
.github/workflows.Additional Notes
Validation intentionally skips
extensions/external-assetsbecause it is not a canvas extension directory.By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.