Enhance Gitea badges workflow with cache support and additional parameters; update badge awarding script for improved error handling and S3 integration; modify badges.json to adjust worker count and document cache usage in README
Gitea badges / award (push) Canceled after 43s
Gitea badges / award (push) Canceled after 43s
This commit is contained in:
1 parent
ec8522633b
commit
243eea2aa3
5 files changed
+419
-47
No files matched your search
@@ -9,11 +9,15 @@ on:
|
||||
description: "Chỉ in kế hoạch, không gán/gỡ badge"
|
||||
type: boolean
|
||||
default: false
|
||||
rebuild_cache:
|
||||
description: "Bỏ qua cache trên RustFS, quét lại toàn bộ rồi ghi cache mới"
|
||||
type: boolean
|
||||
default: false
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- scripts/gitea-badges/**
|
||||
- .github/workflows/gitea-badges.yaml
|
||||
- .gitea/workflows/gitea-badges.yaml
|
||||
|
||||
jobs:
|
||||
award:
|
||||
@@ -28,4 +32,11 @@ jobs:
|
||||
BADGE_TOKEN: ${{ secrets.BADGE_ADMIN_TOKEN }}
|
||||
# push -> dry-run để review thay đổi config; schedule -> chạy thật
|
||||
DRY_RUN: ${{ github.event_name == 'push' && 'true' || github.event.inputs.dry_run || 'false' }}
|
||||
# Cache trên RustFS — thiếu bucket/key thì script tự chạy full scan
|
||||
CACHE_S3_ENDPOINT: ${{ vars.CACHE_S3_ENDPOINT || 'https://rustfs.sothink.vn' }}
|
||||
CACHE_S3_BUCKET: ${{ vars.CACHE_S3_BUCKET }}
|
||||
CACHE_S3_KEY: gitea-badges/cache.json.gz
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CACHE_S3_ACCESS_KEY }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CACHE_S3_SECRET_KEY }}
|
||||
CACHE_REBUILD: ${{ github.event.inputs.rebuild_cache || 'false' }}
|
||||
run: python3 scripts/gitea-badges/award_badges.py --config scripts/gitea-badges/badges.json
|
||||
Reference in new issue
Block a user