File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Rotation automatique du CHANGELOG
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+
11+ jobs :
12+ changelog-rotation :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout du code
16+ uses : actions/checkout@v4
17+ - name : Vérifier la taille du CHANGELOG.md
18+ id : check_size
19+ run : |
20+ if [ -f CHANGELOG.md ]; then
21+ size=$(stat -c%s "CHANGELOG.md")
22+ echo "Taille du CHANGELOG.md : $size octets"
23+ if [ "$size" -gt 10485760 ]; then
24+ echo "ARCHIVE=true" >> $GITHUB_ENV
25+ else
26+ echo "ARCHIVE=false" >> $GITHUB_ENV
27+ fi
28+ else
29+ echo "ARCHIVE=false" >> $GITHUB_ENV
30+ fi
31+ - name : Archiver le CHANGELOG si nécessaire
32+ if : env.ARCHIVE == 'true'
33+ run : |
34+ head -n -1000 CHANGELOG.md > CHANGELOG-archive.md
35+ tail -n 1000 CHANGELOG.md > CHANGELOG.md
36+ git config --global user.name "github-actions"
37+ git config --global user.email "github-actions@github.com"
38+ git add CHANGELOG.md CHANGELOG-archive.md
39+ git commit -m "docs(changelog): rotation automatique du changelog (>10Mo)"
40+ git push
Original file line number Diff line number Diff line change 1+ name : Génération automatique du CHANGELOG
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - main
10+
11+ jobs :
12+ changelog :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout du code
16+ uses : actions/checkout@v4
17+ - name : Générer le CHANGELOG
18+ uses : TriPSs/conventional-changelog-action@v4
19+ with :
20+ github-token : ${{ secrets.GITHUB_TOKEN }}
21+ output-file : CHANGELOG.md
22+ skip-version-file : true
23+ skip-commit : false
24+ skip-tag : true
25+ commit-message : " docs(changelog): mise à jour automatique du CHANGELOG.md"
You can’t perform that action at this time.
0 commit comments