This commit is contained in:
platane
2020-07-19 18:14:53 +02:00
parent a4ea2a4a46
commit 724bc749a2
7 changed files with 32 additions and 12 deletions

View File

@@ -6,7 +6,7 @@ on:
- master
jobs:
test:
deploy-demo:
runs-on: ubuntu-latest
steps:

View File

@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install gifsicle graphicsmagick
# - run: sudo apt-get install gifsicle graphicsmagick
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
@@ -15,6 +15,14 @@ jobs:
- uses: bahmutov/npm-install@v1
- run: yarn type
- run: yarn lint
- run: yarn test --ci
# - run: yarn type
# - run: yarn lint
# - run: yarn test --ci
# - run: yarn build:lib
- name: generate-snake-game-from-github-contribution-grid
uses: Platane/snk@v0.0.2
with:
github_user_name: platane
- run: ls

View File

@@ -4,7 +4,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends gifsicle graphicsmagick \
&& rm -rf /var/lib/apt/lists/*
COPY packages/action/dist/* ./github-contribution-grid-snake
COPY packages/action/dist/* ./generate-snake-game-from-github-contribution-grid/
CMD ["node", "github-contribution-grid-snake/index.js"]
CMD ["node", "generate-snake-game-from-github-contribution-grid/index.js"]

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# snk
Generates a snake game from a github user contributions grid and output a screen capture as gif

View File

@@ -1,10 +1,10 @@
name: "github-contribution-grid-snake"
description: ""
name: "generate-snake-game-from-github-contribution-grid"
description: "Generates a snake game from a github user contributions grid and output a screen capture as gif"
author: "platane"
outputs:
gif_out_path:
description: ""
description: "path of the generated gif"
runs:
using: "docker"
@@ -15,9 +15,9 @@ runs:
inputs:
github_user_name:
description: ""
description: "github user name"
required: true
gif_out_path:
description: ""
description: "path of the generated gif"
required: false
default: "./github-contribution-grid-snake.gif"

View File

@@ -1,5 +1,6 @@
{
"name": "snk",
"description": "Generates a snake game from a github user contributions grid and output a screen capture as gif",
"version": "1.0.0",
"private": true,
"repository": "github:platane/snk",

View File

@@ -4,12 +4,20 @@ import { generateContributionSnake } from "./generateContributionSnake";
(async () => {
try {
console.log("argv", process.argv);
console.log(core.getInput("user_name"));
console.log(core.getInput("gif_out_path"));
console.log("--");
console.log("--");
console.log(process.cwd());
console.log("--");
console.log(fs.readdirSync(process.cwd()));
console.log("--");
console.log("--");
console.log(process.env.GITHUB_WORKSPACE);
console.log("--");
console.log(fs.readdirSync(process.cwd()));
const buffer = await generateContributionSnake(core.getInput("user_name"));
fs.writeFileSync(core.getInput("gif_out_path"), buffer);