File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22. " $( dirname " $0 " ) /_/husky.sh"
33
4+ # Check for changelog files in staged changes
5+ ./scripts/check-changelog.sh
6+
47npx lint-staged
Original file line number Diff line number Diff line change 1+ type : Added
2+ issues : []
3+ description : Add workflow to verify that all commits in a PR are signed
4+ public : true
5+ tags :
6+ - None
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Check if there are any new changelog files in the staged changes
4+ # This script ensures that each commit includes at least one new changelog file
5+
6+ # Get list of staged files
7+ staged_files=$( git diff --cached --name-only)
8+
9+ # Check if any staged files are in the changelogs directory
10+ changelog_files=$( echo " $staged_files " | grep " ^changelogs/" || true)
11+
12+ if [ -z " $changelog_files " ]; then
13+ echo " ❌ Error: No changelog files found in staged changes."
14+ echo " Please add at least one new changelog file to your commit."
15+ echo " Changelog files should be placed in the 'changelogs/' directory."
16+ echo " "
17+ echo " Example:"
18+ echo " git add changelogs/$( date +%Y-%m-%d-%H%M%S) .yml"
19+ exit 1
20+ fi
21+
22+ # Count the number of changelog files
23+ changelog_count=$( echo " $changelog_files " | wc -l | tr -d ' ' )
24+
25+ echo " ✅ Found $changelog_count changelog file(s) in staged changes:"
26+ echo " $changelog_files " | sed ' s/^/ /'
27+
28+ exit 0
You can’t perform that action at this time.
0 commit comments