ci(forgejo): generate banlist history graph\n\n- Add scripts/banlist_metrics.py to compute counts from git history and render chart\n- Add Forgejo workflow using demisto/matplotlib image + warm-workspace checkout\n- Keep GitHub workflow for portability; remove old .gitea workflow\n- Update README with embedded SVG and CSV link
Some checks failed
Generate banlist history graph / build (push) Failing after 1s
Some checks failed
Generate banlist history graph / build (push) Failing after 1s
This commit is contained in:
parent
b719be8d6e
commit
3a8d73edcd
4 changed files with 352 additions and 0 deletions
53
.github/workflows/generate-banlist-graph.yml
vendored
Normal file
53
.github/workflows/generate-banlist-graph.yml
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
name: Generate banlist history graph
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'banned.txt'
|
||||
- 'scripts/banlist_metrics.py'
|
||||
- '.github/workflows/generate-banlist-graph.yml'
|
||||
schedule:
|
||||
- cron: '17 3 * * *'
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install matplotlib
|
||||
|
||||
- name: Generate metrics and chart
|
||||
run: |
|
||||
python scripts/banlist_metrics.py \
|
||||
--file banned.txt \
|
||||
--csv metrics/banlist_counts.csv \
|
||||
--image assets/banlist_history.svg
|
||||
|
||||
- name: Commit changes (if any)
|
||||
run: |
|
||||
git config user.name "actions-bot"
|
||||
git config user.email "actions@users.noreply.github.com"
|
||||
if [ -n "$(git status --porcelain -- metrics assets)" ]; then
|
||||
git add metrics assets
|
||||
git commit -m "chore: update banlist history graph [skip ci]"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit."
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue