@martin-fenocchio/release-notes-bot
v1.2.0
Published
Automated release notes generator using GitLab API and OpenAI
Maintainers
Readme
Release Notes Bot
Automated release notes generator using GitLab API.
Setup
- Install dependencies:
pnpm install- Build the project:
pnpm buildUsage
Using npx (Recommended - No installation needed)
Option 1: Using -p flag (most reliable)
npx -p @martin-fenocchio/release-notes-bot release-notes-bot --before <commit-hash-1> --after <commit-hash-2> --projectId <gitlab-project-id> --token <gitlab-token> --openaiToken <openai-token> [--slackToken <slack-token> --slackChannelId <slack-channel-id>]Option 2: Direct npx (may require clearing cache)
npx @martin-fenocchio/release-notes-bot --before <commit-hash-1> --after <commit-hash-2> --projectId <gitlab-project-id> --token <gitlab-token> --openaiToken <openai-token> [--slackToken <slack-token> --slackChannelId <slack-channel-id>]If Option 2 doesn't work, try clearing npx cache:
rm -rf ~/.npm/_npxDevelopment Mode (using ts-node)
pnpm dev --before <commit-hash-1> --after <commit-hash-2> --projectId <gitlab-project-id> --token <gitlab-token> --openaiToken <openai-token> [--slackToken <slack-token> --slackChannelId <slack-channel-id>]Production Mode (after building)
pnpm start --before <commit-hash-1> --after <commit-hash-2> --projectId <gitlab-project-id> --token <gitlab-token> --openaiToken <openai-token> [--slackToken <slack-token> --slackChannelId <slack-channel-id>]Or directly with node:
node dist/cli.js --before <commit-hash-1> --after <commit-hash-2> --projectId <gitlab-project-id> --token <gitlab-token> --openaiToken <openai-token> [--slackToken <slack-token> --slackChannelId <slack-channel-id>]Arguments
--before: The commit hash to compare from (older commit)--after: The commit hash to compare to (newer commit)--projectId: Your GitLab project ID (can be found in project settings)--token: Your GitLab personal access token withapiscope--openaiToken: Your OpenAI API key (starts withsk-)--slackToken: (Optional) Your Slack bot token (starts withxoxb-). If provided,--slackChannelIdis also required.--slackChannelId: (Optional) Slack channel ID or user DM ID where release notes will be sent. Required if--slackTokenis provided. Slack failures are non-fatal and will only log a warning.
Example
Using npx (Recommended)
npx -p @martin-fenocchio/release-notes-bot release-notes-bot --before abc123 --after def456 --projectId 12345 --token glpat-xxxxxxxxxxxxx --openaiToken sk-xxxxxxxxxxxxx --slackToken xoxb-xxxxxxxxxxxxx --slackChannelId C09TVLQ33HNLocal Development
pnpm dev --before abc123 --after def456 --projectId 12345 --token glpat-xxxxxxxxxxxxx --openaiToken sk-xxxxxxxxxxxxx --slackToken xoxb-xxxxxxxxxxxxx --slackChannelId C09TVLQ33HNGitLab CI Integration
In your .gitlab-ci.yml, you can use it like this:
generate-release-notes:
script:
- npx -p @martin-fenocchio/release-notes-bot release-notes-bot --before "$CI_COMMIT_BEFORE_SHA" --after "$CI_COMMIT_SHA" --projectId "$CI_PROJECT_ID" --token "$GITLAB_TOKEN" --openaiToken "$OPENAI_TOKEN" --slackToken "$SLACK_TOKEN" --slackChannelId "$SLACK_CHANNEL_ID"