-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (40 loc) · 1.3 KB
/
check-release-condition.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Check release condition
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
release-candidate:
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.title, 'release')
steps:
- name: checkout
uses: actions/checkout@v4
- name: Dump version
env:
PR_TITLE: ${{ github.event.pull_request.title }}
id: release
run: |
echo $PR_TITLE | grep -E "release:? v[0-9\-\.]*" || exit 1
VERSION=$(echo $PR_TITLE | sed -E 's/.* (v[0-9\-\.]*)/\1/g')
echo $VERSION
echo ::set-output name=version::$VERSION
- name: Dump poetry version
id: poetry
run: |
VERSION=$(grep version pyproject.toml | sed -E 's/.* "([0-9\-\.]*)"/v\1/g')
echo $VERSION
echo ::set-output name=version::$VERSION
- name: Check version
run: |
if [[ "${{ steps.release.outputs.version }}" == "${{ steps.poetry.outputs.version }}" ]]; then
echo "VERSION MATCH"
else
echo "VERSION MISMATCH"
exit 1
fi
- name: Check CHANGELOG
run: |
if [[ $(grep "${{ steps.release.outputs.version }}" CHANGELOG.md) == "" ]]; then
echo "VERSION MISMATCH"
exit 1
fi