Update United States #50392
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Top GitHub Users | |
| on: | |
| schedule: | |
| # Chạy mỗi ngày lúc 00:00 UTC | |
| - cron: "0 0 * * *" | |
| push: | |
| branches: | |
| - "main" | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: GitHub Active Users | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| # ---- Debug dung lượng trước khi dọn (chỉ để xem) ---- | |
| - name: Show disk before cleanup | |
| run: df -h | |
| # ---- Dọn bớt các tool nặng trên GitHub-hosted runner ---- | |
| - name: Free disk space on runner | |
| uses: endersonmenezes/free-disk-space@v3 | |
| with: | |
| remove_android: true | |
| remove_dotnet: true | |
| remove_haskell: true | |
| remove_tool_cache: true | |
| remove_swap: true | |
| - name: Show disk after cleanup | |
| run: df -h | |
| # ---- Checkout repo (dùng PAT của bạn để action có quyền push nếu cần) ---- | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.CUSTOM_TOKEN }} | |
| # ---- Đảm bảo config.json & checkpoint.json tồn tại, nếu mất thì tạo bản default ---- | |
| - name: Ensure config.json exists | |
| run: | | |
| if [ ! -f config.json ]; then | |
| echo '{ | |
| "locations": ["Vietnam"], | |
| "batchSize": 25, | |
| "devMode": false | |
| }' > config.json | |
| fi | |
| - name: Ensure checkpoint.json exists | |
| run: | | |
| if [ ! -f checkpoint.json ]; then | |
| echo '{ | |
| "lastUpdated": null | |
| }' > checkpoint.json | |
| fi | |
| # ---- Xoá dữ liệu sinh ra ở lần chạy trước (cache/docs), KHÔNG đụng vào config/checkpoint ---- | |
| - name: Remove old generated data | |
| run: | | |
| rm -rf cache | |
| rm -rf docs | |
| # ---- Setup Node ---- | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18.16.1 | |
| # ---- Chạy TOP GITHUB USERS ACTION ---- | |
| - name: TOP GITHUB USERS ACTION | |
| uses: ePlus-DEV/top-github-users-action@master | |
| env: | |
| CUSTOM_TOKEN: ${{ secrets.CUSTOM_TOKEN }} | |
| # ---- Dọn workspace cuối job cho nhẹ ---- | |
| - name: Cleanup workspace | |
| if: always() | |
| run: | | |
| rm -rf cache | |
| rm -rf docs | |
| rm -rf node_modules | |
| rm -rf dist build .next .nuxt | |
| # (optional) Xem thư mục nào còn nặng nhất | |
| - name: Top 20 biggest dirs | |
| if: always() | |
| run: | | |
| du -h . | sort -h | tail -n 20 |