Complicated git log command doesn't output correctly

I have the following step:

      - name: Generate Changelog
        shell: bash
        run: |
          echo "## ${{ github.event.inputs.description }}" > ./CHANGELOG.md
          git log --format=reference $(if [[ $(git tag -l) ]]; then git desctibe --tags --abbrev=0; else git rev-list --max-parents=0 HEAD; fi)..HEAD >> ./CHANGELOG.md
          cat ./CHANGELOG.md

If I run these commands locally I get the expected output:

## OwO this is a test release x3
36baa33 (Whoops #21, 2021-11-17)
a1b5516 (Whoops #21, 2021-11-17)
d596720 (Whoops #20, 2021-11-17)
9cb774c (Whoops #19, 2021-11-17)
a565507 (Whoops #18, 2021-11-17)
f19525f (Whoops #17, 2021-11-17)
aa2af61 ([ci-skip][lint-skip]Whoops #16, 2021-11-14)
d6291b5 ([ci-skip][lint-skip]Whoops #14, 2021-11-14)
e64ea25 ([ci-skip][lint-skip]Whoops #13, 2021-11-13)
152a3e7 ([ci-skip][lint-skip]Whoops #13, 2021-11-13)
61612b4 ([ci-skip][lint-skip]Whoops #12, 2021-11-13)
b6c4a2b ([ci-skip][lint-skip]Whoops #11, 2021-11-13)
c946018 ([ci-skip][lint-skip]Whoops #10, 2021-11-13)
6b07a65 ([ci-skip][lint-skip]Whoops #9, 2021-11-13)
e6de6e3 ([ci-skip][lint-skip]Whoops #8, 2021-11-13)
bfabade ([ci-skip][lint-skip]Whoops #7, 2021-11-13)
b918e99 ([ci-skip][lint-skip]Whoops #6, 2021-11-13)
a7b00a2 ([ci-skip][lint-skip]Whoops #5, 2021-11-13)
28163db ([ci-skip][lint-skip]Whoops #4, 2021-11-13)
997b8ed ([ci-skip][lint-skip]Whoops #3, 2021-11-13)
579f825 ([ci-skip][lint-skip]Whoops #2, 2021-11-13)
90e7835 (Whoops #1, 2021-11-13)

However, when running the workflow on Github I get the following output:
2021-11-17T15:57:56.1352642Z ## OwO this is a test release x3
This leads me to assume that either the nested substitutions somehow just died, or that GitHub actions doesn’t like my git log command (it outputs nothing)…
Any idea how I could fix this?