Skip to content

Commit

Permalink
add changelog workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
constanca-m committed Apr 16, 2024
1 parent 52a7649 commit 1956c5d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/changelog.yml
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

0 comments on commit 1956c5d

Please sign in to comment.