Skip to content

Instantly share code, notes, and snippets.

@rockerhieu
Last active June 22, 2019 20:13
Show Gist options
  • Save rockerhieu/7edf3209f412e6e6e7244241eb3977b2 to your computer and use it in GitHub Desktop.
Save rockerhieu/7edf3209f412e6e6e7244241eb3977b2 to your computer and use it in GitHub Desktop.
Generate release notes from git history
#!/bin/sh
if [ -n "$CIRCLE_COMPARE_URL" ]; then
git log --reverse `echo $CIRCLE_COMPARE_URL | sed 's/^\([^.]*\)\.\.\.\([^.]*\)$/\1/' | sed 's/^.*\/\([^/]*\)$/\1/'` --pretty=format:"%s" | sed '/^Merge .*$/d'
fi
if [ -n "$SHIPPABLE_COMMIT_RANGE" ]; then
git log --reverse `echo $SHIPPABLE_COMMIT_RANGE | sed 's/^\([^.]*\)\.\.\.\([^.]*\)$/\1/'`..`echo $SHIPPABLE_COMMIT_RANGE | sed 's/^\([^.]*\)\.\.\.\([^.]*\)$/\2/'` --pretty=format:"%s" | sed '/^Merge .*$/d'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment