From 61552258d7a33849222a1ced9b88ac2fd1c93535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Sch=C3=B6lzel?= Date: Tue, 4 Jan 2022 18:44:01 +0100 Subject: [PATCH] switches whole working directory instead of just path for RELEASE_HEAD.md --- .github/workflows/test.yml | 2 +- action.yml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b252f51..7a571ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,5 +35,5 @@ jobs: - uses: CSchoel/release-notes-from-changelog@v1.1 with: version: 1.1.0 - head-path: subdir/RELEASE_HEAD.md + working-directory: subdir - run: cat RELEASE.md diff --git a/action.yml b/action.yml index 1ccd9bc..7443291 100644 --- a/action.yml +++ b/action.yml @@ -23,10 +23,10 @@ inputs: description: 'Number of lines to chop from end of matching part of CHANGELOG.md' required: false default: '2' - head-path: - description: 'Path to header file used for release notes' + working-directory: + description: 'Path to folder where CHANGELOG.md and RELEASE_HEAD.md can be found and where RELEASE.md should be placed' required: false - default: 'RELEASE_HEAD.md' + default: '.' runs: using: "composite" steps: @@ -42,13 +42,14 @@ runs: - name: Extract changelog for release version shell: bash + working-directory: ${{ inputs.working-directory }} # explanation of sed command: # 1. select lines between begin-pattern and end-pattern # 2. invert this selection # 3. delete it # => only selection is remaining in stream run: | - cp "${{ inputs.head-path }}" RELEASE.md + cp RELEASE_HEAD.md RELEASE.md printf "\n" >> RELEASE.md echo "Pattern used for sed: ${{ inputs.begin-pattern }},${{ inputs.end-pattern }} ! d" sed -e "${{ inputs.begin-pattern }},${{ inputs.end-pattern }} ! d" CHANGELOG.md | head -n -${{ inputs.chop }} >> RELEASE.md