Skip to content

Commit

Permalink
Check changelog on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jun 22, 2021
1 parent 9b90be4 commit 059cd02
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Check CHANGELOG.md
run: ./scripts/check_CHANGELOG.sh "${{ github.ref }}"

- name: Login
run: echo ${{ secrets.CRATES_IO_TOKEN }} | cargo login

Expand Down
22 changes: 22 additions & 0 deletions scripts/check_CHANGELOG.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! /bin/bash

# set -x
set -euo pipefail

if [[ $# -ne 1 ]]; then
echo "$0: expect one argument: `github.ref`" >&2
exit 1
fi

REF="$1"

if [[ ${REF::11} != 'refs/tags/v' ]]; then
echo "$0: expect \`github.ref\` to start with \`refs/tags/v\`: $REF" >&2
exit 1
fi

VERSION="${REF:11}"

cd "$(dirname "$0")"/..

grep "^## $VERSION$" CHANGELOG.md

0 comments on commit 059cd02

Please sign in to comment.