Skip to content

Commit fb9f7fa

Browse files
committed
feat: add validation workflow, changelog automation, VS Code config, and analytics
- Add validation workflow to check customization files on PRs - Add auto-generated CHANGELOG.md with release integration - Add VS Code workspace recommendations (extensions and settings) - Add Dependabot for GitHub Actions updates - Add repository analytics section with star history - Enhance README with workflow status badges
1 parent a71a8bb commit fb9f7fa

File tree

7 files changed

+377
-19
lines changed

7 files changed

+377
-19
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
# GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
open-pull-requests-limit: 5
11+
commit-message:
12+
prefix: "chore"
13+
include: "scope"
14+
labels:
15+
- "dependencies"
16+
- "github-actions"

.github/workflows/release.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
branches:
66
- main
77
paths-ignore:
8-
- '**.md'
9-
- 'LICENSE'
10-
- '.github/ISSUE_TEMPLATE/**'
11-
- '.github/PULL_REQUEST_TEMPLATE.md'
8+
- "**.md"
9+
- "LICENSE"
10+
- ".github/ISSUE_TEMPLATE/**"
11+
- ".github/PULL_REQUEST_TEMPLATE.md"
1212

1313
permissions:
1414
contents: write
@@ -40,19 +40,19 @@ jobs:
4040
else
4141
COMMITS=$(git log ${{ steps.get_latest_tag.outputs.latest_tag }}..HEAD --pretty=format:"%s")
4242
fi
43-
43+
4444
echo "Commits since last tag:"
4545
echo "$COMMITS"
46-
46+
4747
# Determine bump type based on conventional commits
4848
BUMP="patch"
49-
49+
5050
if echo "$COMMITS" | grep -qiE "^(feat|feature)(\(.+\))?!:|^BREAKING CHANGE:|breaking:"; then
5151
BUMP="major"
5252
elif echo "$COMMITS" | grep -qiE "^(feat|feature)(\(.+\))?:"; then
5353
BUMP="minor"
5454
fi
55-
55+
5656
echo "bump=$BUMP" >> $GITHUB_OUTPUT
5757
echo "Version bump type: $BUMP"
5858
@@ -61,16 +61,16 @@ jobs:
6161
run: |
6262
LATEST_TAG="${{ steps.get_latest_tag.outputs.latest_tag }}"
6363
BUMP="${{ steps.version_bump.outputs.bump }}"
64-
64+
6565
# Remove 'v' prefix if present
6666
VERSION=${LATEST_TAG#v}
67-
67+
6868
# Split version into parts
6969
IFS='.' read -r -a VERSION_PARTS <<< "$VERSION"
7070
MAJOR="${VERSION_PARTS[0]:-0}"
7171
MINOR="${VERSION_PARTS[1]:-0}"
7272
PATCH="${VERSION_PARTS[2]:-0}"
73-
73+
7474
# Bump version
7575
if [ "$BUMP" = "major" ]; then
7676
MAJOR=$((MAJOR + 1))
@@ -82,7 +82,7 @@ jobs:
8282
else
8383
PATCH=$((PATCH + 1))
8484
fi
85-
85+
8686
NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
8787
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
8888
echo "New version: $NEW_VERSION"
@@ -92,10 +92,10 @@ jobs:
9292
run: |
9393
LATEST_TAG="${{ steps.get_latest_tag.outputs.latest_tag }}"
9494
NEW_VERSION="${{ steps.new_version.outputs.new_version }}"
95-
95+
9696
echo "# Release $NEW_VERSION" > CHANGELOG.md
9797
echo "" >> CHANGELOG.md
98-
98+
9999
if [ "$LATEST_TAG" = "v0.0.0" ]; then
100100
echo "## Initial Release" >> CHANGELOG.md
101101
echo "" >> CHANGELOG.md
@@ -121,29 +121,29 @@ jobs:
121121
fi
122122
done
123123
fi
124-
124+
125125
# Read changelog into output
126126
CHANGELOG=$(cat CHANGELOG.md)
127127
echo "changelog<<EOF" >> $GITHUB_OUTPUT
128128
echo "$CHANGELOG" >> $GITHUB_OUTPUT
129129
echo "EOF" >> $GITHUB_OUTPUT
130-
130+
131131
cat CHANGELOG.md
132132
133133
- name: Check if release needed
134134
id: check_release
135135
run: |
136136
LATEST_TAG="${{ steps.get_latest_tag.outputs.latest_tag }}"
137-
137+
138138
# Count commits since last tag
139139
if [ "$LATEST_TAG" = "v0.0.0" ]; then
140140
COMMIT_COUNT=$(git rev-list --count HEAD)
141141
else
142142
COMMIT_COUNT=$(git rev-list --count $LATEST_TAG..HEAD)
143143
fi
144-
144+
145145
echo "Commits since last release: $COMMIT_COUNT"
146-
146+
147147
if [ "$COMMIT_COUNT" -eq 0 ]; then
148148
echo "needs_release=false" >> $GITHUB_OUTPUT
149149
echo "No new commits, skipping release"
@@ -164,6 +164,31 @@ jobs:
164164
draft: false
165165
prerelease: false
166166

167+
- name: Update CHANGELOG.md
168+
if: steps.check_release.outputs.needs_release == 'true'
169+
run: |
170+
NEW_VERSION="${{ steps.new_version.outputs.new_version }}"
171+
DATE=$(date +%Y-%m-%d)
172+
173+
# Create entry for CHANGELOG.md
174+
echo "## [$NEW_VERSION] - $DATE" > /tmp/changelog_entry.md
175+
echo "" >> /tmp/changelog_entry.md
176+
cat CHANGELOG.md >> /tmp/changelog_entry.md
177+
echo "" >> /tmp/changelog_entry.md
178+
179+
# Insert after the "Unreleased" section
180+
sed -i.bak '/^---$/r /tmp/changelog_entry.md' CHANGELOG.md
181+
rm CHANGELOG.md.bak
182+
183+
# Configure git
184+
git config user.name "github-actions[bot]"
185+
git config user.email "github-actions[bot]@users.noreply.github.com"
186+
187+
# Commit and push
188+
git add CHANGELOG.md
189+
git commit -m "chore: update CHANGELOG for $NEW_VERSION [skip ci]"
190+
git push origin main
191+
167192
- name: Summary
168193
if: steps.check_release.outputs.needs_release == 'true'
169194
run: |

0 commit comments

Comments
 (0)