diff --git a/.circleci/config.yml b/.circleci/config.yml index 90ac1e0998..907fe97622 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -106,28 +106,23 @@ jobs: # $CHANGE_TOKEN is generated via the GitHub web UI, and then securely stored within CircleCI web UI command: | mkdir ~/changelog_build - git status - if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then - github_changelog_generator \ - --exclude-tags-regex "^(?!v).*?$" \ - --user bids-standard \ - --project bids-specification \ - --token ${CHANGE_TOKEN} \ - --output ~/changelog_build/CHANGES.md \ - --base ~/project/src/pregh-changes.md \ - --header-label "# Changelog" \ - --release-branch master \ - --no-issues \ - --no-filter-by-milestone \ - --no-compare-link \ - --pr-label "" \ - --enhancement-label "" \ - --bugs-label "" \ - --exclude-labels "exclude-from-changelog" - cat ~/changelog_build/CHANGES.md - else - echo "Commit or Release, do nothing" - fi + github_changelog_generator \ + --exclude-tags-regex "^(?!v).*?$" \ + --user bids-standard \ + --project bids-specification \ + --token ${CHANGE_TOKEN} \ + --output ~/changelog_build/CHANGES.md \ + --base ~/project/src/pregh-changes.md \ + --header-label "# Changelog" \ + --release-branch master \ + --no-issues \ + --no-filter-by-milestone \ + --no-compare-link \ + --pr-label "" \ + --enhancement-label "" \ + --bugs-label "" \ + --exclude-labels "exclude-from-changelog" + cat ~/changelog_build/CHANGES.md - persist_to_workspace: # raw generated changelog in ~/changelog_build/CHANGES.md root: ~/. @@ -151,24 +146,19 @@ jobs: name: remark on autogenerated CHANGES.md # format changelog, then use sed to change * to -, then lint changelog command: | - git status - if (git log -1 --pretty=%s | grep Merge*) && (! git log -1 --pretty=%b | grep REL:) ; then - head -n 100 ~/changelog_build/CHANGES.md - npx remark-cli ~/changelog_build/CHANGES.md --rc-path ~/project/.remarkrc --output ~/changelog_build/CHANGES.md - head -n 100 ~/changelog_build/CHANGES.md - sed -i 's/* /- /' ~/changelog_build/CHANGES.md - head -n 100 ~/changelog_build/CHANGES.md - npx remark-cli ~/changelog_build/CHANGES.md --frail --rc-path ~/project/.remarkrc - else - echo "Commit or Release, do nothing" - fi + head -n 100 ~/changelog_build/CHANGES.md + npx remark-cli ~/changelog_build/CHANGES.md --rc-path ~/project/.remarkrc --output ~/changelog_build/CHANGES.md + head -n 100 ~/changelog_build/CHANGES.md + sed -i 's/* /- /' ~/changelog_build/CHANGES.md + head -n 100 ~/changelog_build/CHANGES.md + npx remark-cli ~/changelog_build/CHANGES.md --frail --rc-path ~/project/.remarkrc - persist_to_workspace: # linted and fixed changelog in ~/changelog_build/CHANGES.md root: ~/. paths: - changelog_build - # Push built changelog to repo + # Push built changelog to repo (only if if last commit was a "Merge commit" on master) commit_generated_changelog: docker: - image: cimg/base:stable @@ -194,7 +184,7 @@ jobs: git commit -m "[DOC] Auto-generate changelog entry for PR ${PR_number}" git push https://${CHANGE_TOKEN}@github.com/bids-standard/bids-specification.git master else - echo "Commit or Release, do nothing" + echo "Did not detect a "Merge commit" to master, or detected a Release ... doing nothing." fi workflows: