Skip to content

Commit

Permalink
switches whole working directory instead of just path for RELEASE_HEA…
Browse files Browse the repository at this point in the history
…D.md
  • Loading branch information
CSchoel committed Jan 4, 2022
1 parent 74a21d7 commit 6155225
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:
- uses: CSchoel/[email protected]
with:
version: 1.1.0
head-path: subdir/RELEASE_HEAD.md
working-directory: subdir
- run: cat RELEASE.md
9 changes: 5 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 6155225

Please sign in to comment.