diff --git a/.github/workflows/editor-changelog.yaml b/.github/workflows/editor-changelog.yaml index f4720ac76e..f006c90ea4 100644 --- a/.github/workflows/editor-changelog.yaml +++ b/.github/workflows/editor-changelog.yaml @@ -25,13 +25,24 @@ jobs: CURRENT_VERSION=$(node -p "require('./packages/editor/package.json').version") echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV + - name: Check if changelog for this version already exists + id: check_existing_changelog + run: | + if [ -f packages/editor/CHANGELOG.md ] && grep -q "## Changelog for version $CURRENT_VERSION" packages/editor/CHANGELOG.md; then + echo "changelog_exists=true" >> $GITHUB_ENV + else + echo "changelog_exists=false" >> $GITHUB_ENV + fi + - name: Get latest published version from npm + if: env.changelog_exists == 'false' id: get_npm_version run: | NPM_VERSION=$(npm view @serlo/editor version) echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV - name: Check if version has changed + if: env.changelog_exists == 'false' id: check_version run: | if [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then