Skip to content

Commit c2e9ebb

Browse files
Merge pull request #44 from DeDuckProject/fix/root-action-yml
Fix/root action yml
2 parents 0c0d319 + 7267221 commit c2e9ebb

File tree

4 files changed

+108
-2
lines changed

4 files changed

+108
-2
lines changed

action.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'GitGlimpse'
2+
description: 'Auto-generate visual demo clips for UI changes in pull requests'
3+
author: 'git-glimpse'
4+
branding:
5+
icon: 'video'
6+
color: 'purple'
7+
8+
inputs:
9+
trigger-mode:
10+
description: 'Trigger mode: auto, on-demand, or smart (overrides config file)'
11+
required: false
12+
start-command:
13+
description: 'Command to start the app (overrides config file)'
14+
required: false
15+
preview-url:
16+
description: 'External preview deployment URL (e.g., from Vercel)'
17+
required: false
18+
config-path:
19+
description: 'Path to git-glimpse.config.ts'
20+
default: 'git-glimpse.config.ts'
21+
required: false
22+
format:
23+
description: 'Output format: gif, mp4, or webm'
24+
default: 'gif'
25+
required: false
26+
max-duration:
27+
description: 'Max recording duration in seconds'
28+
default: '30'
29+
required: false
30+
31+
outputs:
32+
recording-url:
33+
description: 'URL of the uploaded recording artifact'
34+
comment-url:
35+
description: 'URL of the posted PR comment'
36+
success:
37+
description: 'Whether the recording succeeded (true/false)'
38+
39+
runs:
40+
using: 'node20'
41+
main: 'packages/action/dist/index.js'

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
"lint": "pnpm -r lint"
1919
},
2020
"devDependencies": {
21+
"@types/js-yaml": "^4.0.9",
22+
"@types/node": "^20.12.0",
23+
"js-yaml": "^4.1.1",
2124
"typescript": "^5.4.5",
22-
"vitest": "^1.6.0",
23-
"@types/node": "^20.12.0"
25+
"vitest": "^1.6.0"
2426
}
2527
}

pnpm-lock.yaml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/unit/action-yml.test.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { describe, it, expect } from 'vitest';
2+
import { readFileSync } from 'fs';
3+
import { resolve } from 'path';
4+
import { load } from 'js-yaml';
5+
6+
const root = resolve(__dirname, '../..');
7+
8+
function loadActionYml(path: string): any {
9+
return load(readFileSync(path, 'utf8'));
10+
}
11+
12+
describe('root action.yml', () => {
13+
const rootAction = loadActionYml(resolve(root, 'action.yml'));
14+
const pkgAction = loadActionYml(resolve(root, 'packages/action/action.yml'));
15+
16+
it('points main to packages/action/dist/index.js', () => {
17+
expect(rootAction.runs.main).toBe('packages/action/dist/index.js');
18+
});
19+
20+
it('uses node20 runtime', () => {
21+
expect(rootAction.runs.using).toBe('node20');
22+
});
23+
24+
it('has the same inputs as packages/action/action.yml', () => {
25+
expect(Object.keys(rootAction.inputs ?? {})).toEqual(
26+
Object.keys(pkgAction.inputs ?? {})
27+
);
28+
});
29+
30+
it('has the same outputs as packages/action/action.yml', () => {
31+
expect(Object.keys(rootAction.outputs ?? {})).toEqual(
32+
Object.keys(pkgAction.outputs ?? {})
33+
);
34+
});
35+
36+
it('packages/action/action.yml still uses relative dist path', () => {
37+
expect(pkgAction.runs.main).toBe('dist/index.js');
38+
});
39+
});

0 commit comments

Comments
 (0)