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"