Skip to content

Commit a740a39

Browse files
authored
Merge pull request #81 from control-toolbox/contributors
✨ Add automated contributors page
2 parents c7d7884 + 083657c commit a740a39

13 files changed

Lines changed: 2475 additions & 3 deletions
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Update Contributors Page
2+
3+
on:
4+
schedule:
5+
- cron: '0 6 * * 1' # Every Monday at 6:00 UTC (8:00 AM in France)
6+
workflow_dispatch: # Allow manual trigger
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
update-contributors:
13+
name: 🌟 Update Contributors Page
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: 📥 Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: 🐍 Setup Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
cache: 'pip'
28+
29+
- name: 📦 Install Python dependencies
30+
run: |
31+
echo "📦 Installing Python dependencies..."
32+
pip install -r scripts/requirements.txt
33+
echo "✅ Dependencies installed"
34+
35+
- name: 🔍 Verify dependencies
36+
run: |
37+
echo "🔍 Verifying installed packages..."
38+
python3 -c "import requests; print(f'✓ requests {requests.__version__}')"
39+
python3 -c "import dotenv; print(f'✓ python-dotenv installed')"
40+
echo "✅ All dependencies verified"
41+
42+
- name: 🌟 Generate contributors page
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
echo "🌟 Generating contributors page..."
47+
echo "📊 Analyzing repositories..."
48+
cd scripts
49+
python3 github_contributors.py --web
50+
echo "✅ Contributors page generated"
51+
52+
- name: 📊 Check if file was generated
53+
run: |
54+
if [ -f "about/contributors.md" ]; then
55+
echo "✅ Contributors page exists"
56+
echo "📄 File size: $(stat -f%z about/contributors.md 2>/dev/null || stat -c%s about/contributors.md 2>/dev/null) bytes"
57+
echo ""
58+
echo "📋 First 10 lines:"
59+
head -n 10 about/contributors.md
60+
else
61+
echo "❌ Contributors page not found!"
62+
exit 1
63+
fi
64+
65+
- name: 🔧 Configure git
66+
run: |
67+
echo "🔧 Configuring git user..."
68+
git config --global user.name "github-actions[bot]"
69+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
70+
echo "✅ Git user configured"
71+
72+
- name: 📝 Commit and push changes
73+
run: |
74+
echo "🌳 Checking git status..."
75+
git status
76+
77+
echo ""
78+
echo "📊 Adding contributors page..."
79+
git add about/contributors.md
80+
81+
# Check if there are changes to commit
82+
if git diff --cached --quiet; then
83+
echo "ℹ️ No changes detected in contributors page"
84+
echo "📊 Page is already up to date"
85+
exit 0
86+
fi
87+
88+
echo "✅ Changes detected, preparing commit..."
89+
echo ""
90+
echo "📋 Files to be committed:"
91+
git diff --cached --name-status
92+
93+
echo ""
94+
echo "📝 Committing changes..."
95+
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M UTC")
96+
git commit -m "🌟 Update contributors page" \
97+
-m "Automated update of the contributors page" \
98+
-m "Generated on: $TIMESTAMP" \
99+
-m "" \
100+
-m "This commit was automatically created by the Update Contributors workflow."
101+
102+
echo "✅ Changes committed"
103+
104+
echo ""
105+
echo "🚀 Pushing to repository..."
106+
git push origin main || git push origin master
107+
echo "✅ Changes pushed successfully"
108+
109+
- name: ✅ Workflow summary
110+
if: always()
111+
run: |
112+
echo ""
113+
echo "=========================================="
114+
echo "📊 Contributors Page Update Summary"
115+
echo "=========================================="
116+
echo ""
117+
118+
if [ -f "about/contributors.md" ]; then
119+
echo "✅ Contributors page: Generated"
120+
echo "📁 Location: about/contributors.md"
121+
echo "🌐 URL: https://control-toolbox.org/contributors/"
122+
else
123+
echo "❌ Contributors page: Failed to generate"
124+
fi
125+
126+
echo ""
127+
echo "🕒 Workflow completed at: $(date -u +"%Y-%m-%d %H:%M UTC")"
128+
echo "=========================================="

.gitignore

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
11
.DS_Store
2-
_site
2+
_site
3+
.extras
4+
.vscode
5+
.jekyll-cache
6+
7+
# Jekyll
8+
.sass-cache/
9+
.jekyll-metadata
10+
Gemfile.lock
11+
12+
# Ruby
13+
*.gem
14+
*.rbc
15+
/.config
16+
/coverage/
17+
/InstalledFiles
18+
/pkg/
19+
/spec/reports/
20+
/spec/examples.txt
21+
/test/tmp/
22+
/test/version_tmp/
23+
/tmp/
24+
25+
# Bundler
26+
/.bundle/
27+
/vendor/bundle
28+
/lib/bundler/man/
29+
30+
# Python
31+
__pycache__/
32+
*.py[cod]
33+
*$py.class
34+
*.so
35+
.Python
36+
*.egg
37+
*.egg-info/
38+
dist/
39+
build/
40+
.env
41+
.venv
42+
venv/
43+
ENV/
44+
45+
# Preview files
46+
preview_contributors.html

Gemfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 3.9.0"
4+
gem "jekyll-theme-primer"
5+
gem "jekyll-seo-tag"
6+
gem "webrick", "~> 1.7"
7+
gem "csv"
8+
gem "base64"
9+
gem "bigdecimal"
10+
gem "logger"
11+
gem "kramdown-parser-gfm"

_layouts/default.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525

2626
<div id="documenter">
2727

28-
<!-- title -->
29-
<h1 id="ct-title"><img id="ct-logo-title" src="assets/img/ct-logo.svg">control-toolbox
28+
<!-- title (only on home page) -->
29+
{% if page.url == "/" %}
30+
<h1 id="ct-title"><img id="ct-logo-title" src="/assets/img/ct-logo.svg">control-toolbox
3031
</h1>
32+
{% endif %}
3133
<!-- end title -->
3234

3335
<!-- content -->

about/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)