Skip to content

Commit

Permalink
refactor(ci): Generate changelog only when it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikey Stengel committed Oct 9, 2024
1 parent 05f0311 commit c0a39ea
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/editor-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0a39ea

Please sign in to comment.