yoshi389111 / github-profile-3d-contrib

This GitHub Action creates a GitHub contribution calendar on a 3D profile image.
MIT License
1.03k stars 166 forks source link
github-action github-contribution-graph github-contributions github-profile github-profile-readme profile-readme

GitHub Profile 3D Contrib.

svg

日本語 | Español

Overview

This GitHub Action creates a GitHub contribution calendar on a 3D profile image.

How to use (GitHub Actions) - Basic

This action generate your github profile 3d contribute calendar and make a commit to your repo. You can also trigger action by yourself after add this action.

step 1. Create special repository.

Create a repository on GitHub with the same name as your user name.

In this repository, do the following.

step 2. Create workflow file.

Create a workflow file like the one below.

The schedule is set to start once a day. Please correct the startup time to a convenient time.

name: GitHub-Profile-3D-Contrib

on:
  schedule: # 03:00 JST == 18:00 UTC
    - cron: "0 18 * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: generate-github-profile-3d-contrib
    steps:
      - uses: actions/checkout@v3
      - uses: yoshi389111/github-profile-3d-contrib@0.7.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          USERNAME: ${{ github.repository_owner }}
      - name: Commit & Push
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add -A .
          git commit -m "generated"
          git push

Note: If you also want to include the private repository, register the "personal access token" in the repository and set it to GITHUB_TOKEN specified in the workflow file.

This will add the action to the repository.

Environment variables

step 3. Manually launch the action

Launch the added action.

The profile image is generated with the following paths.

Alternatively, if SETTING_JSON is specified, the following image will be generated.

example: green version

svg

example: season version (Northern Hemisphere.)

svg

example: season version (Southern Hemisphere.)

svg

example: night view version

svg

example: night green version

svg

example: night rainbow version

svg

example: git block version

svg

step 4. Add image to README.md

Add the path of the generated image to the readme file.

e.g.

![](./profile-3d-contrib/profile-green-animate.svg)

How to use (GitHub Actions) - Advanced examples

More info in EXAMPLES.md

How to use (local)

Set the GITHUB_TOKEN environment variable to the value of "personal access token".

export GITHUB_TOKEN=XXXXXXXXXXXXXXXXXXXXX

Run it with your GitHub user specified.

node_modules/.bin/ts-node src/index.ts USER_NAME

or

npm run build
node . USER_NAME

Licence

MIT License

(C) 2021 SATO, Yoshiyuki