From 55fb353e6fb72613ab7684db60688e662b4bfa17 Mon Sep 17 00:00:00 2001 From: Francis Charette Migneault Date: Tue, 3 Dec 2024 14:48:52 -0500 Subject: [PATCH] fix section changes HTML generation from makefile --- .github/workflows/zenodo.yml | 1 + Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/zenodo.yml b/.github/workflows/zenodo.yml index db3019b1c..570565832 100644 --- a/.github/workflows/zenodo.yml +++ b/.github/workflows/zenodo.yml @@ -28,6 +28,7 @@ jobs: - name: Generate Changelog id: zenodo_metadata run: | + cd make generate-changes-html VERSION=${{ github.ref_name }} echo "ZENODO_DESCRIPTION=$(cat reports/CHANGES_${{ github.ref_name }}.html | tr -d '\n')" >> $GITHUB_ENV diff --git a/Makefile b/Makefile index d8b96cf13..4ae91606d 100644 --- a/Makefile +++ b/Makefile @@ -759,10 +759,10 @@ extract-changes: ## uses the specified VERSION to extract its sub-section in CHA @-echo "Extracting changes for ${VERSION} ..." @bash -c '\ START=$$(cat "$(APP_ROOT)/CHANGES.rst" | grep -n "crim-ca/weaver/tree/${VERSION}" | cut -d ":" -f 1); \ - STOP=$$(tail -n +$$(($${START} + 2)) "$(APP_ROOT)/CHANGES.rst" \ + STOP=$$(tail -n +$$(($${START:-0} + 2)) "$(APP_ROOT)/CHANGES.rst" \ | grep -n ".. _changes" \ | cut -d ":" -f 1 | head -n 1); \ - tail -n +$${START} "$(APP_ROOT)/CHANGES.rst" | head -n $${STOP} \ + tail -n +$${START:-0} "$(APP_ROOT)/CHANGES.rst" | head -n $${STOP:--1} \ > "$(REPORTS_DIR)/CHANGES_${VERSION}.rst" \ '