TER publishing with GitHub Releases in 2025

I've updated my extension publishing workflow based on GitHub Actions and TYPO3 Tailor. The original post was written back in 2021 and has now been updated to reflect the recent changes to GitHub Actions. Furthermore the workflow logic is more stable now, than in the original version.

The idea of this workflow is, to use the release notes from the GitHub releases to be used as the upload comment in the TER.

name: publish
on:
    release:
        # Run, when a releases is created or edited
        types: [ created, edited ]
jobs:
    publish:
        name: Publish to TER
        # Run only, if the ref (in this case the tag, the release is based on) starts with `refs/tags/v`
        if: startsWith(github.ref, 'refs/tags/v')
        runs-on: ubuntu-latest
        env:
            TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
        steps:
            -   name: Checkout repository
                uses: actions/checkout@v4

            -   name: Check tag
                run: |
                    if ! [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
                      exit 1
                    fi

            -   name: Setup PHP
                uses: shivammathur/setup-php@v2
                with:
                    php-version: 7.4
                    extensions: intl, mbstring, json, zip, curl
                    tools: composer:v2

            -   name: Install tailor
                run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest

            -   name: Publish to TER
                env:
                    # Set the release body as environment variable to avoid issues with escaping and special characters like quotes and backticks
                    RELEASE_BODY: ${{ github.event.release.body }}
                run: |
                    # Determine the version from the ref/tag: Strip the `v` prefix
                    version=${GITHUB_REF/refs\/tags\/v/}
                    # Use the environment variable for the comment
                    comment="$RELEASE_BODY"
                    
                    if [[ -z "${comment// }" ]]; then
                        # Use fallback comment, if the release is empty
                        comment="Released version $version"
                    fi
                    
                    php ~/.composer/vendor/bin/tailor ter:publish --comment "$comment" "$version"

Feel free to use this in your own extension.