-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
80 lines (70 loc) · 2.16 KB
/
action.yml
File metadata and controls
80 lines (70 loc) · 2.16 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: 'GitHub Contribution Gravity Lens'
description: 'Generate gravity lens animation from GitHub contributions'
author: 'Rujuu-prog'
branding:
icon: 'activity'
color: 'purple'
inputs:
github-token:
description: 'GitHub token for API access'
required: true
username:
description: 'GitHub username (default: repository owner)'
required: false
default: ''
theme:
description: 'Theme name (github, deep-space, monochrome, solar-flare, event-horizon, paper-light)'
required: false
default: 'github'
format:
description: 'Output format (svg or gif)'
required: false
default: 'svg'
output-path:
description: 'Output file path'
required: false
default: ''
strength:
description: 'Warp strength (0-1)'
required: false
default: '0.35'
outputs:
output-path:
description: 'Path to generated file'
value: ${{ steps.generate.outputs.output-path }}
runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
shell: bash
run: cd "${{ github.action_path }}" && npm ci
- name: Build
shell: bash
run: cd "${{ github.action_path }}" && npm run build
- name: Generate gravity lens
id: generate
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
USERNAME="${{ inputs.username }}"
[ -z "$USERNAME" ] && USERNAME="${{ github.repository_owner }}"
OUTPUT_PATH="${{ inputs.output-path }}"
if [ -z "$OUTPUT_PATH" ]; then
OUTPUT_PATH="${GITHUB_WORKSPACE}/gravity-lens.${{ inputs.format }}"
elif [[ "$OUTPUT_PATH" != /* ]]; then
OUTPUT_PATH="${GITHUB_WORKSPACE}/${OUTPUT_PATH}"
fi
mkdir -p "$(dirname "$OUTPUT_PATH")"
node "${{ github.action_path }}/dist/cli.js" \
--user "$USERNAME" \
--token "$GITHUB_TOKEN" \
--theme "${{ inputs.theme }}" \
--format "${{ inputs.format }}" \
--strength "${{ inputs.strength }}" \
--output "$OUTPUT_PATH"
echo "output-path=$OUTPUT_PATH" >> "$GITHUB_OUTPUT"