Skip to content

Commit 68cd1ae

Browse files
committed
ci(release): validate tag version metadata
1 parent 04d4baa commit 68cd1ae

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ jobs:
5252
- name: Install Elixir dependencies
5353
run: mix deps.get
5454

55+
- name: Validate tag, mix.exs version, and changelog version
56+
env:
57+
TAG_NAME: ${{ github.ref_name }}
58+
run: |
59+
tag_version="${TAG_NAME#v}"
60+
mix_version=$(mix run -e 'IO.write(Mix.Project.config()[:version])')
61+
62+
if [ "$tag_version" != "$mix_version" ]; then
63+
echo "Tag version $tag_version does not match mix.exs version $mix_version"
64+
exit 1
65+
fi
66+
67+
if ! grep -q "^## \[$tag_version\]" CHANGELOG.md; then
68+
echo "CHANGELOG.md does not contain a section for version $tag_version"
69+
exit 1
70+
fi
71+
5572
- name: Check formatting
5673
run: mix format --check-formatted
5774

0 commit comments

Comments
 (0)