-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
66 lines (60 loc) · 1.76 KB
/
action.yml
File metadata and controls
66 lines (60 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: 'PR Visual'
description: 'Generate infographic images from PR diffs using Gemini AI'
author: 'pr-visual'
branding:
icon: 'image'
color: 'purple'
inputs:
gemini-api-key:
description: 'Gemini API key for image generation'
required: false
hosted-api-key:
description: 'API key for hosted pr-visual service (future)'
required: false
prompt:
description: 'Custom prompt for image generation (bypasses diff analysis)'
required: false
style:
description: 'Visual style: clean, excalidraw, minimal, tech, playful'
required: false
default: 'clean'
comment:
description: 'Whether to post a comment on the PR'
required: false
default: 'true'
github-token:
description: 'GitHub token for API access'
required: false
default: ${{ github.token }}
outputs:
image-path:
description: 'Path to the generated image'
value: ${{ steps.generate.outputs.image-path }}
image-url:
description: 'URL to the image in the repo'
value: ${{ steps.generate.outputs.image-url }}
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
shell: bash
working-directory: ${{ github.action_path }}
run: |
cd action
npm ci
- name: Generate PR Visual
id: generate
shell: bash
env:
GEMINI_API_KEY: ${{ inputs.gemini-api-key }}
HOSTED_API_KEY: ${{ inputs.hosted-api-key }}
GITHUB_TOKEN: ${{ inputs.github-token }}
INPUT_PROMPT: ${{ inputs.prompt }}
INPUT_STYLE: ${{ inputs.style }}
INPUT_COMMENT: ${{ inputs.comment }}
ACTION_PATH: ${{ github.action_path }}
run: node ${{ github.action_path }}/action/run.js