Add Gitea badges workflow and scripts for awarding badges based on user activity
This commit is contained in:
1 parent
c0a1d50c9d
commit
3a5ec76030
5 files changed
+414
No files matched your search
@@ -0,0 +1,31 @@
|
||||
name: Gitea badges
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 * * * *" # every hour, minute 30
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry_run:
|
||||
description: "Chỉ in kế hoạch, không gán/gỡ badge"
|
||||
type: boolean
|
||||
default: false
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- scripts/gitea-badges/**
|
||||
- .github/workflows/gitea-badges.yaml
|
||||
|
||||
jobs:
|
||||
award:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Award badges
|
||||
env:
|
||||
GITEA_URL: ${{ vars.GITEA_URL || github.server_url }}
|
||||
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' }}
|
||||
run: python3 scripts/gitea-badges/award_badges.py --config scripts/gitea-badges/badges.json
|
||||
Reference in new issue
Block a user