-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52a7649
commit 1956c5d
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
## Workflow to check CHANGELOG was updated when version gets updated in share/version.py | ||
name: changelog | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'share/version.py' | ||
|
||
jobs: | ||
|
||
changelog: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Get version number | ||
shell: bash | ||
run: | | ||
VERSION=$(awk '/version/ {print $3}' share/version.py | tr -d '"') | ||
echo "VERSION=${VERSION}" >> $GITHUB_ENV | ||
echo "::notice::ESF version is $VERSION." | ||
- name: Check changelog | ||
shell: bash | ||
run: | | ||
first_line=$(awk 'NR==1' CHANGELOG.md) | ||
if [[ $first_line != *" v${{ env.VERSION }} "* ]]; then | ||
error="CHANGELOG should contain the new version in its first line, like this ' v1.1.1 '." | ||
reminder="Do not forget to add space before and after the version in the CHANGELOG first line." | ||
echo "::error::$error $reminder" | ||
exit 1 | ||
fi |