A beautifully stylized collection of resources.
Comprehensive guide and documentation for Next.js framework.
Utility-first CSS framework for rapid UI development.
A production-ready motion library for React.
A collection of beautifully designed components for React.
The GitHubStarCount
component displays the current star count of a GitHub repository. It uses the GitHub GraphQL API to fetch the star count and updates it nightly via a GitHub Action.
import GitHubStarCount from './components/GitHubStarCount';
const App = () => (
<div>
<GitHubStarCount repo="owner/repo" />
</div>
);
export default App;
The GitHubStarGraph
component displays the star history graph of a GitHub repository. It uses the GitHub GraphQL API to fetch the star history and displays it in a dropdown.
import GitHubStarGraph from './components/GitHubStarGraph';
const App = () => (
<div>
<GitHubStarGraph repo="owner/repo" />
</div>
);
export default App;
The update-star-data.yml
workflow fetches the star data of a GitHub repository using the GitHub GraphQL API and saves it to data/star-data.json
. The workflow is scheduled to run nightly.
- Create a new file at
.github/workflows/update-star-data.yml
. - Add the following content to the file:
name: Update Star Data
on:
schedule:
- cron: '0 0 * * *'
jobs:
update-star-data:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Fetch GitHub Star Data
run: |
python scripts/github_star_data.py
- name: Commit and Push Changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add data/star-data.json
git commit -m 'Update star data'
git push
- Ensure you have a
data
directory at the root of your repository with astar-data.json
file. - The workflow will run nightly and update the star data.