Skip to content

Update Contributions SVG #213

Update Contributions SVG

Update Contributions SVG #213

name: Update Contributions SVG
on:
# 하루 3번 자동 실행 (UTC 00:00, 08:00, 16:00 = 한국시간 09:00, 17:00, 01:00)
schedule:
- cron: '0 0,8,16 * * *'
# 수동 실행 지원
workflow_dispatch:
# main/master 브랜치 push 시 실행
push:
branches:
- main
- master
paths:
- 'src/**'
- 'featured-prs.json'
- '.github/workflows/update-contributions.yml'
jobs:
update-svg:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate contributions SVG
env:
GITHUB_USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 설정 옵션 (Settings > Secrets and variables > Actions > Variables에서 설정)
THEME: ${{ vars.THEME || 'light' }}
AUTO_THEME: ${{ vars.AUTO_THEME || 'false' }}
MAX_REPOS: ${{ vars.MAX_REPOS || '6' }}
TITLE: ${{ vars.TITLE || 'Open-Source Contributions' }}
SORT_BY: ${{ vars.SORT_BY || 'date' }}
MONTHS_AGO: ${{ vars.MONTHS_AGO || '' }}
EXCLUDE_ORGS: ${{ vars.EXCLUDE_ORGS || '' }}
INCLUDE_ORGS: ${{ vars.INCLUDE_ORGS || '' }}
FEATURED_PRS_PATH: ${{ vars.FEATURED_PRS_PATH || './featured-prs.json' }}
OUTPUT_PATH: './contributions.svg'
PREVIEW_THEMES: 'dark'
run: node src/index.js
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add contributions*.svg
git diff --staged --quiet || git commit -m "chore: update contributions SVG [skip ci]"
git push