Skip to content

Commit

Permalink
chore: test
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciNyan committed Aug 14, 2024
1 parent be53f56 commit 74342ca
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 2 deletions.
36 changes: 36 additions & 0 deletions action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "generate-pixel-github-stats"
description: "Generates a github stats card from a github user contributions."
author: "platane"

runs:
using: node20
main: dist/index.js

inputs:
github_user_name:
description: "github user name"
required: true
github_token:
description: "github token used to fetch the contribution calendar. Default to the action token if empty."
required: false
default: ${{ github.token }}
outputs:
required: false
default: null
description: |
list of files to generate.
one file per line. Each output can be customized with options as query string.
supported query string options:
- palette: A preset of color, one of [github, github-dark, github-light]
- color_snake: Color of the snake
- color_dots: Coma separated list of dots color.
The first one is 0 contribution, then it goes from the low contribution to the highest.
Exactly 5 colors are expected.
example:
outputs: |
dark.svg?palette=github-dark&color_snake=blue
light.svg?color_snake=#7845ab
ocean.svg?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9
13 changes: 13 additions & 0 deletions packages/github-action/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as core from '@actions/core'
;(async () => {
try {
const userName = core.getInput('github_user_name')
// const githubToken = process.env.GITHUB_TOKEN ?? core.getInput('github_token')

console.log(':::userName', userName)
console.log(':::process.env.GITHUB_TOKEN', process.env.GITHUB_TOKEN)
console.log(":::core.getInput('github_token')", core.getInput('github_token'))
} catch (e: any) {
core.setFailed(`Action failed with "${e.message}"`)
}
})()
15 changes: 15 additions & 0 deletions packages/github-action/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "pixel-profile-action",
"version": "1.0.0",
"dependencies": {
"@actions/core": "1.10.1"
},
"devDependencies": {
"@vercel/ncc": "0.38.0",
"dotenv": "16.3.1"
},
"scripts": {
"build": "ncc build --external canvas --external gifsicle --out ../../action/dist ./index.ts",
"run:build": "INPUT_GITHUB_USER_NAME=platane INPUT_OUTPUTS='../../action/dist/out.svg' node dist/index.js"
}
}
2 changes: 1 addition & 1 deletion packages/pixel-profile-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"pixel-profile": "workspace:*",
"ts-known": "^0.1.3"
},
"packageManager": "pnpm@8.7.0",
"packageManager": "pnpm@9.7.0",
"engines": {
"node": ">=18.17.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/pixel-profile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"*.{js,css,md}": "prettier --write",
"*.{ts,tsx}": "eslint --fix"
},
"packageManager": "pnpm@8.7.0",
"packageManager": "pnpm@9.7.0",
"engines": {
"node": ">=18.17.0"
}
Expand Down
47 changes: 47 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 74342ca

Please sign in to comment.