Skip to content

Commit

Permalink
Merge pull request #1314 from snyk/fix/changelog-script
Browse files Browse the repository at this point in the history
Handle patch releases in changelog script
  • Loading branch information
eliecharra authored and sundowndev committed Jan 11, 2022
1 parent 42d9259 commit e9e7dbe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/changelog.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env bash

# This script compare merged pull requests between the two most recent tags
# Please note that this script only work with Github repositories.
# Prerequisites: git, github cli

GHCLI_BIN="gh"
REPO="snyk/driftctl"
LATEST_TAG=$(git describe --abbrev=0) # Get the least created tag
DEFAULT_BRANCH=origin/HEAD
BASE=$DEFAULT_BRANCH # Change this if you don't want to use the default branch as base
LATEST_TAG=$(git for-each-ref --sort=-taggerdate --format '%(tag)' refs/tags | sed -n 1p) # Get the last created tag
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
BASE=$(git for-each-ref --sort=-taggerdate --format '%(tag)' refs/tags | sed -n 2p) # Use $CURRENT_BRANCH instead to get a pre-release changelog

# Check GH cli is installed
if ! which $GHCLI_BIN &> /dev/null; then
Expand Down

0 comments on commit e9e7dbe

Please sign in to comment.