Skip to content

Commit

Permalink
Add action for towncrier build draft changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed May 14, 2024
1 parent eac09da commit 825f2f6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions towncrier-draft/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Towncrier - draft changelog
description: Draft the changelog for the next release. Write the output to the GH Actions job summary.

inputs:
version:
description: Package version (if not a Python project).
required: false

runs:
using: composite
steps:
- name: Install Towncrier if needed
shell: bash
run: python3 -m pip install -q towncrier

- name: Draft changelog
shell: bash
env:
VER: ${{ inputs.version }}
run: |
CMD="towncrier build --draft --date 'CCYY-MM-DD'"
if [[ -n "$VER" ]]; then
CMD="$CMD --version $VER"
fi
echo -e "# Draft changelog\n" >> "$GITHUB_STEP_SUMMARY"
$CMD | tee -a "$GITHUB_STEP_SUMMARY"

0 comments on commit 825f2f6

Please sign in to comment.