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 - master
jobs: jobs:
test: deploy-demo:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: sudo apt-get install gifsicle graphicsmagick # - run: sudo apt-get install gifsicle graphicsmagick
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
@@ -15,6 +15,14 @@ jobs:
- uses: bahmutov/npm-install@v1 - uses: bahmutov/npm-install@v1
- run: yarn type # - run: yarn type
- run: yarn lint # - run: yarn lint
- run: yarn test --ci # - 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 \ && apt-get install -y --no-install-recommends gifsicle graphicsmagick \
&& rm -rf /var/lib/apt/lists/* && 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" name: "generate-snake-game-from-github-contribution-grid"
description: "" description: "Generates a snake game from a github user contributions grid and output a screen capture as gif"
author: "platane" author: "platane"
outputs: outputs:
gif_out_path: gif_out_path:
description: "" description: "path of the generated gif"
runs: runs:
using: "docker" using: "docker"
@@ -15,9 +15,9 @@ runs:
inputs: inputs:
github_user_name: github_user_name:
description: "" description: "github user name"
required: true required: true
gif_out_path: gif_out_path:
description: "" description: "path of the generated gif"
required: false required: false
default: "./github-contribution-grid-snake.gif" default: "./github-contribution-grid-snake.gif"

View File

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

View File

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