diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f84a483..cc0d643 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -142,19 +142,13 @@ jobs: if [ -z "$PREVIOUS_TAG" ]; then echo "ℹ️ No previous tag found, this might be the first release" - # Get all commits up to current commit - use heredoc for multiline - NOTES=$(cat </dev/null); then + echo "✅ Successfully generated initial release notes for version $CURRENT_VERSION" + else + echo "⚠️ Could not generate initial release notes for version $CURRENT_VERSION" + NOTES="Initial release v$CURRENT_VERSION" + fi echo "has-notes=true" >> $GITHUB_OUTPUT diff --git a/scripts/generate-initial-release-notes.js b/scripts/generate-initial-release-notes.js new file mode 100644 index 0000000..b3768be --- /dev/null +++ b/scripts/generate-initial-release-notes.js @@ -0,0 +1,45 @@ +#!/usr/bin/env node + +/** + * Generate release notes for the initial release + * Used by GitHub Actions when no previous tag exists + */ + +const { execSync } = require('child_process'); + +function generateInitialReleaseNotes(version) { + try { + // Get total commit count + const commitCount = execSync('git rev-list --count HEAD', { encoding: 'utf8' }).trim(); + + // Generate release notes + const releaseNotes = [ + '### 🎉 Initial Release', + '', + `This is the initial release of n8n-mcp v${version}.`, + '', + '---', + '', + '**Release Statistics:**', + `- Commit count: ${commitCount}`, + '- First release setup' + ]; + + return releaseNotes.join('\n'); + + } catch (error) { + console.error(`Error generating initial release notes: ${error.message}`); + return `Failed to generate initial release notes: ${error.message}`; + } +} + +// Parse command line arguments +const version = process.argv[2]; + +if (!version) { + console.error('Usage: generate-initial-release-notes.js '); + process.exit(1); +} + +const releaseNotes = generateInitialReleaseNotes(version); +console.log(releaseNotes);