Code Issues Pull Requests Actions Packages Projects Releases 15 Wiki Activity Security Code Quality
Files
global-workflow/.gitea/workflows/gitea-badges.yaml
T
tienbh 3a5ec76030
Gitea badges / award (push) Failing after 37s
gitea/global-workflow: Scan Vulnerabilities / sbom-upload (push) Failing after 54s
Add Gitea badges workflow and scripts for awarding badges based on user activity
2026-11-19 09:23:45 +07:00

32 lines
931 B
YAML

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