Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'GitGlimpse'
description: 'Auto-generate visual demo clips for UI changes in pull requests'
author: 'git-glimpse'
branding:
icon: 'video'
color: 'purple'

inputs:
trigger-mode:
description: 'Trigger mode: auto, on-demand, or smart (overrides config file)'
required: false
start-command:
description: 'Command to start the app (overrides config file)'
required: false
preview-url:
description: 'External preview deployment URL (e.g., from Vercel)'
required: false
config-path:
description: 'Path to git-glimpse.config.ts'
default: 'git-glimpse.config.ts'
required: false
format:
description: 'Output format: gif, mp4, or webm'
default: 'gif'
required: false
max-duration:
description: 'Max recording duration in seconds'
default: '30'
required: false

outputs:
recording-url:
description: 'URL of the uploaded recording artifact'
comment-url:
description: 'URL of the posted PR comment'
success:
description: 'Whether the recording succeeded (true/false)'

runs:
using: 'node20'
main: 'packages/action/dist/index.js'
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
"lint": "pnpm -r lint"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.12.0",
"js-yaml": "^4.1.1",
"typescript": "^5.4.5",
"vitest": "^1.6.0",
"@types/node": "^20.12.0"
"vitest": "^1.6.0"
}
}
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions tests/unit/action-yml.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { describe, it, expect } from 'vitest';
import { readFileSync } from 'fs';
import { resolve } from 'path';
import { load } from 'js-yaml';

const root = resolve(__dirname, '../..');

function loadActionYml(path: string): any {
return load(readFileSync(path, 'utf8'));
}

describe('root action.yml', () => {
const rootAction = loadActionYml(resolve(root, 'action.yml'));
const pkgAction = loadActionYml(resolve(root, 'packages/action/action.yml'));

it('points main to packages/action/dist/index.js', () => {
expect(rootAction.runs.main).toBe('packages/action/dist/index.js');
});

it('uses node20 runtime', () => {
expect(rootAction.runs.using).toBe('node20');
});

it('has the same inputs as packages/action/action.yml', () => {
expect(Object.keys(rootAction.inputs ?? {})).toEqual(
Object.keys(pkgAction.inputs ?? {})
);
});

it('has the same outputs as packages/action/action.yml', () => {
expect(Object.keys(rootAction.outputs ?? {})).toEqual(
Object.keys(pkgAction.outputs ?? {})
);
});

it('packages/action/action.yml still uses relative dist path', () => {
expect(pkgAction.runs.main).toBe('dist/index.js');
});
});
Loading