Socket
Socket
Sign inDemoInstall

extract-changelog-release

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    extract-changelog-release

Extract release notes from latest entry in standard-version changelog


Version published
Weekly downloads
11K
increased by50.19%
Maintainers
1
Install size
61.4 kB
Created
Weekly downloads
 

Changelog

Source

1.0.2 (2021-08-16)

Bug Fixes

  • Make executable with npx (c7c6798)

Readme

Source

extract-changelog-release

npm version Build Status Conventional Commits

Extract release notes from latest entry in standard-version changelog.

This project can be used for automating GH releases with standard-version — see GH Actions example.

Usage

CLI

# Extracts from CHANGELOG.md in the current working directory
npx extract-changelog-release

# Extracts from package/CHANGELOG.md relative to CWD
npx extract-changelog-release ./package/CHANGELOG.md

# Extracts from absolute path /path/to/LOG.md
npx extract-changelog-release /path/to/LOG.md
Example Result
$ extract-changelog-release
## [3.2.0](https://github.com/LeDDGroup/typescript-transform-paths/compare/v3.1.0...v3.2.0) (2021-08-03)

### Features

* Support transformation via ts-node transpileOnly and compiler API transformNodes (closes [#123](https://github.com/LeDDGroup/typescript-transform-paths/issues/123)) ([dd942fd](https://github.com/LeDDGroup/typescript-transform-paths/commit/dd942fdbf34afcdec8f976a1540746521a758c73))

### Bug Fixes

* Custom JSDoc tags not working for older TS (fixes [#126](https://github.com/LeDDGroup/typescript-transform-paths/issues/126)) ([d4280c3](https://github.com/LeDDGroup/typescript-transform-paths/commit/d4280c3dec4dc9f3834fc98be2e51109422bd9aa))

Programmatic

import { extractLog } from 'extract-changelog-release';

let releaseNotes: string;

// Extracts from CHANGELOG.md in the current working directory
releaseNotes = extractLog(); 

// Extracts from package/CHANGELOG.md relative to CWD
releaseNotes = extractLog('package/CHANGELOG.md'); 

// Extracts from absolute path /path/to/LOG.md
releaseNotes = extractLog('/path/to/LOG.md');

GH Actions

Example config

The following action is triggered when a new version tag is pushed. It will:

  • Build
  • Test
  • Publish to NPM
  • Create a GitHub Release based on the latest entry in CHANGELOG.md

.github/workflows/publish.yml

name: Publish

on:
  push:
    tags:
      - v*.*.*

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node.js 14.x to publish to npmjs.org
        uses: actions/setup-node@v1
        with:
          node-version: '14.x'
          registry-url: 'https://registry.npmjs.org'

      - name: Install Packages
        run: yarn install --frozen-lockfile

      - name: Build
        run: yarn build

      - name: Test
        run: yarn test
        env:
          CI: true
          
      - name: Generate Release Body
        run: npx extract-changelog-release > RELEASE_BODY.md

      - name: Publish to NPM
        run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
        
      - name: Create GitHub Release
        uses: ncipollo/release-action@v1
        with:
          bodyFile: "RELEASE_BODY.md"
          token: ${{ secrets.GITHUB_TOKEN }}

Keywords

FAQs

Last updated on 16 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc