Skip to content

Commit b86eb91

Browse files
committed
🚀 publish action
1 parent f0616d5 commit b86eb91

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM golang:1.22
2+
3+
WORKDIR /workspace
4+
5+
COPY . .
6+
7+
RUN go mod tidy
8+
9+
ENTRYPOINT ["go", "run", "cmd/main.go"]

action.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'GitHub README.md Metrics'
2+
description: 'Update your GitHub README.md with cool metrics.'
3+
author: 'Nguyen Thanh Hau'
4+
inputs:
5+
GITHUB_TOKEN:
6+
description: 'GitHub token with repo access'
7+
required: true
8+
WAKATIME_API_KEY:
9+
description: 'WakaTime API key'
10+
required: false
11+
WAKATIME_DATA:
12+
description: 'Data to show from WakaTime'
13+
required: true
14+
WAKATIME_RANGE:
15+
description: 'Range of data to show from WakaTime'
16+
required: true
17+
SHOW_METRICS:
18+
description: 'Use this to specify which metrics to show'
19+
required: true
20+
TIME_ZONE:
21+
description: 'Time zone to show in the metrics'
22+
required: true
23+
TIME_LAYOUT:
24+
description: 'Time layout to show in the metrics'
25+
required: true
26+
SHOW_LAST_UPDATE:
27+
description: 'Show last update in the readme'
28+
required: true
29+
ONLY_MAIN_BRANCH:
30+
description: "Only use main branch's commits"
31+
required: true
32+
outputs:
33+
time:
34+
description: 'The time the action was run'
35+
runs:
36+
using: 'docker'
37+
image: 'Dockerfile'
38+
branding:
39+
icon: 'star'
40+
color: 'orange'

pkg/container/container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func (d *DataContainer) GetStats(cl clock.Clock) string {
6161
}
6262

6363
func showWidgets(w map[string]string, b *strings.Builder) {
64-
for _, k := range strings.Split(os.Getenv("SHOW_WIDGETS"), ",") {
64+
for _, k := range strings.Split(os.Getenv("SHOW_METRICS"), ",") {
6565
v, ok := w[k]
6666
if !ok {
6767
continue

0 commit comments

Comments
 (0)