npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mindtwo/gen-aws-changelog

v1.0.4

Published

Generate changelogs by comparing commits between AWS CodePipeline stages

Downloads

453

Readme

gen-aws-changelog

Generate changelogs by comparing commits between AWS CodePipeline stages for your GitHub repositories.

Overview

gen-aws-changelog is a CLI tool that fetches the current deployment state from AWS CodePipeline stages and generates a changelog showing all commits between two stages (e.g., staging and production). It uses the GitHub CLI to fetch commit information and compare revisions.

Prerequisites

Before using this tool, ensure you have:

  1. GitHub CLI (gh) installed and authenticated

    # Install gh CLI (macOS)
    brew install gh
    
    # Authenticate
    gh auth login
  2. AWS credentials configured with permissions to read CodePipeline state

    # Configure AWS credentials
    aws configure

    Required AWS permissions:

    • codepipeline:GetPipelineState
    • codepipeline:GetPipelineExecution
  3. Node.js (version 20 or higher)

Installation

npm install -g @mindtwo/gen-aws-changelog

Usage

Basic Command

gen-aws-changelog <org/repo> --pipeline <pipeline-name> --fromStage <stage1> --toStage <stage2>

Example

gen-aws-changelog myorg/myrepo \
  --pipeline my-production-pipeline \
  --fromStage DeployStaging \
  --toStage DeployProduction \
  --region us-east-1

This will output:

### Changes for release DeployStaging (abc1234) to DeployProduction (def5678):

- abc1234 Fix authentication bug
- bcd2345 Add user profile feature
- cde3456 Update dependencies

Creating a GitHub Release

To automatically create a GitHub release with the changelog, add the --tag flag:

gen-aws-changelog myorg/myrepo \
  --pipeline my-production-pipeline \
  --fromStage DeployStaging \
  --toStage DeployProduction \
  --tag

This will:

  • Create a GitHub release with a tag named release-DD-MM-YYYY (current date)
  • Use the changelog as the release description
  • Output the release URL

Command-Line Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | repo | positional | Yes | - | Repository name with organization/owner (e.g., owner/repo) | | --pipeline | string | No* | - | AWS CodePipeline name | | --fromStage | string | No* | - | Starting stage of the pipeline (e.g., DeployStaging) | | --toStage | string | No* | - | Ending stage of the pipeline (e.g., DeployProduction) | | --region | string | No | eu-central-1 | AWS region for CodePipeline | | --verbose | boolean | No | false | Enable verbose logging | | --quiet | boolean | No | false | Only show errors | | --noGit | boolean | No | false | Don't fetch repository configuration from GitHub | | --tag | boolean | No | false | Create a GitHub release with the changelog as description |

* Required unless configured in repository (see Git Repository Configuration below)

Git Repository Configuration

To avoid specifying pipeline configuration on every command, you can configure your repository with a .aws-changelog.json file. This file is automatically fetched from the default branch of your repository.

Configuration File

Create a file named .aws-changelog.json in the root of your repository:

{
  "pipeline": "my-production-pipeline",
  "region": "us-east-1",
  "fromStage": "DeployStaging",
  "toStage": "DeployProduction"
}

Configuration Schema

{
  "pipeline": string,     // CodePipeline name (optional)
  "region": string,       // AWS region (optional, defaults to eu-central-1)
  "fromStage": string,    // Starting stage name (optional)
  "toStage": string       // Ending stage name (optional)
}

Configuration Priority

The tool merges configuration from multiple sources in this order (later sources override earlier ones):

  1. Default values
  2. .aws-changelog.json from repository (if --noGit is not set)
  3. Command-line arguments

Example with Repository Configuration

Once you've added .aws-changelog.json to your repository, you can run:

# Uses configuration from .aws-changelog.json
gen-aws-changelog myorg/myrepo

# Override specific options
gen-aws-changelog myorg/myrepo --toStage DeployCanary

Bypass Repository Configuration

Use --noGit to ignore the repository configuration file:

gen-aws-changelog myorg/myrepo --noGit \
  --pipeline different-pipeline \
  --fromStage Stage1 \
  --toStage Stage2

How It Works

  1. Fetch Repository Config (optional): Uses gh CLI to fetch .aws-changelog.json from the repository's default branch
  2. Query AWS CodePipeline: Fetches the current state of the specified pipeline stages
  3. Extract Commit SHAs: Gets the Git commit SHAs deployed to each stage
  4. Compare Commits: Uses gh CLI to compare commits between the two SHAs
  5. Generate Changelog: Formats and displays the commit messages

Scripts

# Generate changelog
gen-aws-changelog myorg/myrepo --pipeline my-pipeline --fromStage Stage1 --toStage Stage2

Error Handling

The tool will exit with an error if:

  • Repository name format is invalid (must be org/repo)
  • Required configuration is missing
  • AWS CodePipeline stages are not found
  • GitHub repository is not accessible
  • AWS credentials are not configured or lack permissions

Troubleshooting

"Stage not found in pipeline"

Ensure the stage names match exactly (case-sensitive) with your CodePipeline configuration.

# List pipeline stages
aws codepipeline get-pipeline-state --name your-pipeline-name

"Error fetching file from repository"

Ensure:

  • gh CLI is authenticated (gh auth status)
  • You have access to the repository
  • The repository exists and the name is correct

AWS Permission Issues

Verify your AWS credentials have the required permissions:

aws codepipeline get-pipeline-state --name your-pipeline-name

License

MIT