Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 58 additions & 55 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,55 +1,58 @@
# ============================================================
# GitHub Profile Card - Environment Variables
# Copy this file to .env and fill in your values:
# cp .env.example .env
# ============================================================

# -----------------------------------------------
# REQUIRED: GitHub Personal Access Token
# -----------------------------------------------
# Used to query the GitHub GraphQL API for user profiles.
#
# How to get it:
# 1. Go to https://github.com/settings/tokens
# 2. Click "Generate new token (classic)"
# 3. Select scopes: "read:user" and "repo" (for public repo data)
# 4. Generate and copy the token
#
# Or use a fine-grained token:
# 1. Go to https://github.com/settings/personal-access-tokens/new
# 2. Set permissions: "Account" -> "Read-only" for Profile
# 3. Generate and copy the token
#
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# -----------------------------------------------
# OPTIONAL: Upstash Redis (for caching)
# -----------------------------------------------
# Provides a distributed cache layer so responses are fast
# even on cold starts. Without these, only in-memory caching is used.
#
# How to get it:
# 1. Go to https://console.upstash.com/
# 2. Create a new Redis database (free tier is fine)
# 3. Copy the REST URL and Token from the database details page
#
# IMPORTANT: Free-tier Upstash databases are deleted after 14 days
# of inactivity. Use the included GitHub Action (upstash-keep-alive.yml)
# to prevent this by pinging your database every 24 hours.
#
UPSTASH_REDIS_REST_URL=https://xxxxxxxx.upstash.io
UPSTASH_REDIS_REST_TOKEN=AxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxE=

# -----------------------------------------------
# OPTIONAL: Server Port (for local development)
# -----------------------------------------------
# The port the dev server listens on. Defaults to 3000.
#
# PORT=3000

# -----------------------------------------------
# OPTIONAL: Max In-Flight Requests
# -----------------------------------------------
# Limits the number of concurrent requests to the GitHub API.
# Adjust this based on your expected traffic and GitHub API rate limits.
# MAX_IN_FLIGHT_REQUESTS=100
# ============================================================
# GitHub Profile Card - Environment Variables
# Copy this file to .env and fill in your values:
# cp .env.example .env
# ============================================================

# -----------------------------------------------
# REQUIRED: GitHub Personal Access Token
# -----------------------------------------------
# Used to query the GitHub GraphQL API for user profiles.
#
# How to get it:
# 1. Go to https://github.com/settings/tokens
# 2. Click "Generate new token (classic)"
# 3. Select scopes: "read:user" and "repo" (for public repo data)
# 4. Generate and copy the token
#
# Or use a fine-grained token:
# 1. Go to https://github.com/settings/personal-access-tokens/new
# 2. Set permissions: "Account" -> "Read-only" for Profile
# 3. Generate and copy the token
#
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# -----------------------------------------------
# REQUIRED for profile view badges; OPTIONAL for card caching
# -----------------------------------------------
# Provides a distributed cache layer so responses are fast
# even on cold starts. Without these, cards use in-memory caching
# and /profile/:username returns 503. Badge counters do not expire.
# Use persistent storage with no eviction for profile-views:v1:*
# and profile-views:v2. New counters are limited to 100,000 usernames.
#
# How to get it:
# 1. Go to https://console.upstash.com/
# 2. Create a new Redis database (free tier is fine)
# 3. Copy the REST URL and Token from the database details page
#
# IMPORTANT: Free-tier Upstash databases are deleted after 14 days
# of inactivity. Use the included GitHub Action (upstash-keep-alive.yml)
# to prevent this by pinging your database every 24 hours.
#
UPSTASH_REDIS_REST_URL=https://xxxxxxxx.upstash.io
UPSTASH_REDIS_REST_TOKEN=AxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxE=

# -----------------------------------------------
# OPTIONAL: Server Port (for local development)
# -----------------------------------------------
# The port the dev server listens on. Defaults to 3000.
#
# PORT=3000

# -----------------------------------------------
# OPTIONAL: Max In-Flight Requests
# -----------------------------------------------
# Limits the number of concurrent requests to the GitHub API.
# Adjust this based on your expected traffic and GitHub API rate limits.
# MAX_IN_FLIGHT_REQUESTS=100
157 changes: 15 additions & 142 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# CI Pipeline - Sequential Node versions: 20 → 22 → 24 + final summary
# All three versions run one after another regardless of the previous result.
# A final "CI Summary" job reports the outcome:
# - all 3 passed -> "All passed" (green)
# - none passed -> "All failed/skipped/cancelled" (red)
# - some passed -> "N passed, M failed/cancelled/skipped" (red)
#
# Author: Nayan Das (https://github.com/nayandas69)

name: CI

on:
Expand All @@ -16,140 +7,22 @@ on:
branches: [main]

jobs:
test-node-20:
name: Test (Node 20)
runs-on: ubuntu-latest
continue-on-error: true
outputs:
passed: ${{ steps.check.outcome == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1

- name: Install pnpm
uses: pnpm/action-setup@v6.1.0

- name: Setup Node.js 20
uses: actions/setup-node@v7.1.0
with:
node-version: 20
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm typecheck

- name: Lint
run: pnpm lint

- name: Run tests
id: check
run: pnpm test
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

test-node-22:
name: Test (Node 22)
needs: test-node-20
if: always()
check:
name: Check (Node 26 LTS)
runs-on: ubuntu-latest
continue-on-error: true
outputs:
passed: ${{ steps.check.outcome == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1

- name: Install pnpm
uses: pnpm/action-setup@v6.1.0

- name: Setup Node.js 22
uses: actions/setup-node@v7.1.0
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm typecheck

- name: Lint
run: pnpm lint

- name: Run tests
id: check
run: pnpm test
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

test-node-24:
name: Test (Node 24)
needs: test-node-22
if: always()
runs-on: ubuntu-latest
continue-on-error: true
outputs:
passed: ${{ steps.check.outcome == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v7.0.1

- name: Install pnpm
uses: pnpm/action-setup@v6.1.0

- name: Setup Node.js 24
uses: actions/setup-node@v7.1.0
with:
node-version: 24
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Type check
run: pnpm typecheck

- name: Lint
run: pnpm lint

- name: Run tests
id: check
run: pnpm test
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

ci-summary:
name: CI Summary
needs: [test-node-20, test-node-22, test-node-24]
if: always()
runs-on: ubuntu-latest
steps:
- name: Report results across all Node versions
node-version-file: .node-version
- uses: pnpm/action-setup@v6.1.0
- name: Install Redis for integration tests
run: |
PASS=0
for r in \
"${{ needs.test-node-20.outputs.passed }}" \
"${{ needs.test-node-22.outputs.passed }}" \
"${{ needs.test-node-24.outputs.passed }}"; do
[ "$r" = "true" ] && PASS=$((PASS+1))
done
FAIL=$((3 - PASS))

case "$PASS" in
3)
echo "✅ All passed - Node 20, 22, 24 (3/3)"
exit 0
;;
0)
echo "❌ All failed - no Node version passed (0/3 failed/skipped/cancelled)"
exit 1
;;
*)
echo "⚠️ $PASS passed, $FAIL failed/cancelled/skipped"
exit 1
;;
esac
sudo apt-get update -qq
sudo apt-get install -y redis-server
- run: pnpm install --frozen-lockfile
- run: pnpm format:check
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test
- run: pnpm build
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26.13.0
31 changes: 0 additions & 31 deletions ARCHITECTURE.md

This file was deleted.

Loading
Loading