From 825f2f61a082a08369b2651ed092d91b89095c0c Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 14 May 2024 16:31:15 +0100 Subject: [PATCH] Add action for towncrier build draft changelog --- towncrier-draft/action.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 towncrier-draft/action.yml diff --git a/towncrier-draft/action.yml b/towncrier-draft/action.yml new file mode 100644 index 0000000..2b810d6 --- /dev/null +++ b/towncrier-draft/action.yml @@ -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"