-
Notifications
You must be signed in to change notification settings - Fork 1
Improve dashboard skill, examples, and documentation checks #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4da85ce
docs: centralize dashboard component and theme guidance
hackycy 6097e96
refactor(skill): use documentation-first adaptive dashboard workflow
hackycy 4bc4484
feat(examples): add four standalone dashboard compositions and gallery
hackycy b3a3044
test: gate dashboard examples and documentation in CI
hackycy 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
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,37 @@ | ||
| name: Skill examples | ||
|
|
||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| VITEPRESS_BASE: /datav-kit/ | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: pnpm/action-setup@v6 | ||
| with: | ||
| version: 11.6.0 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24 | ||
| cache: pnpm | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm exec playwright install --with-deps chromium | ||
| - run: pnpm exec turbo build --filter='!@datav-kit/docs' | ||
| - run: pnpm docs:build | ||
| - run: pnpm docs:check | ||
| - run: pnpm examples:test | ||
| - uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: example-browser-verification | ||
| path: | | ||
| .cache/playwright-report | ||
| .cache/playwright-results | ||
| .cache/example-screenshots | ||
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 |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ node_modules | |
| temp | ||
| cache | ||
| .eslintcache | ||
| /docs/public/examples/ | ||
|
|
||
| # AI | ||
| .agents | ||
|
|
||
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
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,62 @@ | ||
| import type { Plugin } from 'vite' | ||
| import type { SiteConfig } from 'vitepress' | ||
| import { copyFile, mkdir, readdir, readFile } from 'node:fs/promises' | ||
| import path from 'node:path' | ||
| import { fileURLToPath } from 'node:url' | ||
|
|
||
| const assets = fileURLToPath(new URL('../../skills/datav-kit/assets/', import.meta.url)) | ||
| const examples = path.join(assets, 'examples') | ||
|
|
||
| function sourceFile(name: string): string | undefined { | ||
| if (!/^[a-z-]+\.(?:html|png)$/.test(name)) | ||
| return undefined | ||
| if (name === 'minimal.html') | ||
| return path.join(assets, 'minimal-example.html') | ||
| return path.join(examples, name.endsWith('.png') ? 'previews' : '', name) | ||
| } | ||
|
|
||
| export function skillExamples(base: string): Plugin { | ||
| return { | ||
| name: 'datav-skill-examples', | ||
| async configResolved() { | ||
| // Public files must exist before VitePress resolves image and HTML links. | ||
| await copyExamples(fileURLToPath(new URL('../public/examples/', import.meta.url))) | ||
| }, | ||
| configureServer(server) { | ||
| server.middlewares.use(async (request, response, next) => { | ||
| const pathname = new URL(request.url || '/', 'http://localhost').pathname | ||
| const prefix = `${base}examples/` | ||
| if (!pathname.startsWith(prefix)) | ||
| return next() | ||
| const name = pathname.slice(prefix.length) | ||
| const file = sourceFile(name) | ||
| if (!file) | ||
| return next() | ||
| try { | ||
| const content = await readFile(file) | ||
| response.setHeader('Content-Type', name.endsWith('.png') ? 'image/png' : 'text/html; charset=utf-8') | ||
| response.end(content) | ||
| } | ||
| catch { | ||
| response.statusCode = 404 | ||
| response.end('Example not found') | ||
| } | ||
| }) | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| export async function copySkillExamples(site: SiteConfig): Promise<void> { | ||
| await copyExamples(path.join(site.outDir, 'examples')) | ||
| } | ||
|
|
||
| async function copyExamples(destination: string): Promise<void> { | ||
| await mkdir(destination, { recursive: true }) | ||
| const html = (await readdir(examples)).filter(name => name.endsWith('.html')) | ||
| const previews = (await readdir(path.join(examples, 'previews'))).filter(name => name.endsWith('.png')) | ||
| await Promise.all([...html, ...previews, 'minimal.html'].map(async (name) => { | ||
| const file = sourceFile(name) | ||
| if (file) | ||
| await copyFile(file, path.join(destination, name)) | ||
| })) | ||
| } |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '1,140p' .github/workflows/skill-examples.ymlRepository: hackycy/datav-kit
Length of output: 1068
🌐 Web query:
actions/checkout v4 persist-credentials default .git/config official README💡 Result:
In
actions/checkoutv4, thepersist-credentialsinput defaults totrue[1][2][3]. When set to its default value oftrue, the action configures the authentication token (or SSH key) into the local Git configuration of the repository being checked out [1][4][2]. This allows subsequent steps in your workflow to execute authenticated Git commands (such asgit pushorgit pull) without requiring additional authentication [1][4]. The action removes this token during the post-job cleanup process [1][4]. To opt out of this behavior, you must explicitly setpersist-credentials: falsein your workflow YAML [1][5]. Disabling this is often recommended as a security best practice to prevent other actions or steps in your workflow from accessing the repository credentials [5]. Key technical details: - Default:true[2][3] - Purpose: Configures the token or SSH key in the local.git/config[2][3] - Cleanup: The token is removed by the action during post-job cleanup [1][4] - Security: Explicitly settingpersist-credentials: falseensures the credential is not left in the Git configuration, mitigating potential risks from third-party actions [5]Citations:
Security Misconfiguration
Reachability: External
Exploitability: Difficult
CWE: CWE-522 — Insufficiently Protected Credentials
Disable credential persistence in the checkout step.
actions/checkoutstores the job token in.git/configby default. The workflow runs package installation and browser installation steps that can execute third-party lifecycle scripts. The job does not push changes, so the token is not required.🛡️ Proposed hardening
📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 16-16: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools