name: Yaclog description: Get version information from a changelog branding: icon: file-text color: orange inputs: changelog-path: description: "Path of the changelog markdown file" markdown: description: If outputs should be in markdown format or not default: 'true' release: description: > Creates a new release and commits it if set. Directly passed to the arguments of `yaclog release`. Can be a version number or an increment tag like `--major`, `--minor`, or `--patch`. The resulting commit and tag will NOT be pushed back to the repo. You must add a step to do this yourself outputs: name: description: "The current version name. For example, `Version 1.3.0`" value: ${{ steps.yaclog-show.outputs.name}} header: description: "The entire header for the current version. For example, `Version 1.3.0 - 2024-08-08`" value: ${{ steps.yaclog-show.outputs.header }} version: description: "The current version number. For example, `1.3.0`" value: ${{ steps.yaclog-show.outputs.version }} body-file: description: "Path to a temporary file containing the version body" value: ${{ steps.yaclog-show.outputs.body-file }} body_file: description: "Alias for body-file" value: ${{ steps.yaclog-show.outputs.body-file }} changelog: description: "Path to the entire changelog file." value: ${{ steps.yaclog-show.outputs.changelog }} runs: using: "composite" steps: - id: setup-python uses: actions/setup-python@v5 with: python-version: '3.12' update-environment: 'false' - name: Setup Yaclog shell: bash run: | [[ "$ACTION_REF" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_YACLOG="$ACTION_REF" pipx install --python ${{ steps.setup-python.outputs.python-path }} ${{ github.action_path }} env: ACTION_REF: ${{ github.action_ref }} - name: Create New Release shell: bash if: ${{ inputs.release }} run: yaclog release --yes --commit ${{ inputs.release }} - name: Get Changelog Information id: yaclog-show shell: bash run: > yaclog ${{ inputs.changelog-path && format('--path {0}', inputs.changelog-path) }} show ---gh-actions ${{ inputs.markdown && '--markdown' }} | tee -a "$GITHUB_OUTPUT"