File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed
Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 22 "branches": ["main"],
33 "plugins": [
44 "@semantic-release/commit-analyzer",
5- "@semantic-release/ release-notes-generator ",
5+ "./scripts/ release.js ",
66 "@semantic-release/changelog",
77 "@semantic-release/git",
88 {
Original file line number Diff line number Diff line change 1+ const { execSync } = require ( 'child_process' ) ;
2+ const path = require ( 'path' ) ;
3+ const fs = require ( 'fs' ) ;
4+
5+ module . exports = {
6+ generateNotes : async ( ) => {
7+ const pluginsDir = path . resolve ( process . cwd ( ) , 'plugins' ) ;
8+ let releaseNotes = `# Submodule Commit IDs\n\n` ;
9+
10+ if ( fs . existsSync ( pluginsDir ) ) {
11+ const submodules = fs . readdirSync ( pluginsDir ) ;
12+
13+ submodules . forEach ( submodule => {
14+ const submodulePath = path . join ( pluginsDir , submodule ) ;
15+ if ( fs . existsSync ( path . join ( submodulePath , '.git' ) ) ) {
16+ try {
17+ const commitId = execSync ( `git -C ${ submodulePath } rev-parse HEAD` , { encoding : 'utf-8' } ) . trim ( ) ;
18+ releaseNotes += `- **${ submodule } **: ${ commitId } \n` ;
19+ } catch ( error ) {
20+ releaseNotes += `- **${ submodule } **: Error fetching commit ID\n` ;
21+ }
22+ } else {
23+ releaseNotes += `- **${ submodule } **: Not a Git repository\n` ;
24+ }
25+ } ) ;
26+ } else {
27+ releaseNotes += `No plugins directory found.\n` ;
28+ }
29+
30+ return releaseNotes ;
31+ }
32+ } ;
You can’t perform that action at this time.
0 commit comments