github-activity-box
v0.1.5
Published
⚡️📌️ Update a gist to contain your recent activity
Downloads
209
Readme
github-activity-box
✨ Enhancements
- 🔍 Uses GraphQL API to search for issues and PRs authored by the provided username.
- 🎨 Supports custom descriptions and filtering by specific repos/owners
- ✅ Updated dependencies, rewritten to TypeScript, and refactored the tests.
- 📦 Published to npm with binary support for easy use via
npxorpnpx
[!NOTE]
The original implementation fetched events initiated by the user (so PRs merged by others aren't counted).
Currently, multiple states of the same PR, such as opening and merging, won't be retrieved. Also, comment events are not included.
🚀 Usage
Use as a CLI
# Run directly with npx/pnpx
npx github-activity-box [options]
# Or install globally
npm install -g github-activity-box
github-activity-box [options]Options:
--dry- Preview output without updating the gist
Required Environment Variables:
| Variable | Description |
| --------------- | -------------------------------------------------------------------------------------------------------- |
| GIST_ID | ID portion from your gist URL (https://gist.github.com/username/GIST_ID) |
| GH_PAT | GitHub personal access token with gist scope |
| GH_USERNAME | Your GitHub username |
| DESCRIPTION | (Optional) Description for the gist |
| EXCLUDE_REPO | (Optional) Comma-separated list of repositories to exclude Example: username/repo1,username/repo2 |
| EXCLUDE_OWNER | (Optional) Comma-separated list of owners to exclude Example: username1,username2 |
| ACTIVITY_TYPE | (Optional) Type of activities to display: all (default), issue, or pr |
GitHub Action Setup
Prerequisites
- Create a new public GitHub Gist
- Generate a personal access token with
gistscope
Workflow Configuration
Create .github/workflows/activity-box.yml:
name: Activity Box
on:
workflow_dispatch:
schedule:
- cron: '*/30 * * * *' # Updates every 30 minutes
jobs:
update-activity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Update activity
run: npx github-activity-box@0
env:
GH_PAT: ${{ secrets.GH_PAT }}
GH_USERNAME: your-username
GIST_ID: your-gist-id
# You can also use hardcoded values instead of variables
# EXCLUDE_OWNER: username1,username2
# EXCLUDE_REPO: username/repo1,username/repo2
EXCLUDE_OWNER: ${{ vars.EXCLUDE_OWNER }}
EXCLUDE_REPO: ${{ vars.EXCLUDE_REPO }}
DESCRIPTION: Your custom descriptionAdd Repository Secrets and Variables
- Go to your repository Settings > Secrets and variables > Actions.
- Add a repository secret:
GH_PAT: Your GitHub access token (requiresgistscope).
- (Optional) Add repository variables as needed (
EXCLUDE_OWNER,EXCLUDE_REPO).
Inspired by matchai/bird-box and forked from JasonEtco/activity-box
