Github actions ${{ github.event.release.tag_name }} always null

I’m trying to deploy my repository to a private Docker registry on every new release and everything works except for the version tagging. No matter what I’ve tried ${{ github.event.release.tag_name }} is always '', which cancels the workflow since docker tags can’t be empty.

on:
  release:
    types: [published]


jobs:
  push_to_registry:
    name: Push Docker image to Docker Registry
    runs-on: ubuntu-latest
    steps:
      - 
        name: Check out the repo
        uses: actions/checkout@v2
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - 
        name: Setup Docker Buildx
        uses: docker/setup-buildx-action@v1
      - 
        name: Log in to Docker Registry
        uses: docker/login-action@v1
        with:
          registry: ${{ secrets.DOCKER_REGISTRY }}
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      - name: check tag
        if: ${{ github.event.release.tag_name }} == ''
        run: |
          echo Epic fail
          exit 1
      - 
        name: Build and Push to Docker Registry
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          push: true
          tags: ${{ secrets.DOCKER_REGISTRY }}/repos:latest, ${{ secrets.DOCKER_REGISTRY }}/$repos:${{ github.event.release.tag_name }}
      - 
        name: Image digest
        run: echo ${{ steps.docker_build.outputs.digest }}

The repository this is running on is private so that might have something to do with it but I haven’t been able to figure out what.

Any suggestions?

Try the debugging technique here:

It works fine in a public repo for sure:

name: Release Publication

on:
  release:
    types: [published]
    
jobs:
  job:
    runs-on: ubuntu-latest
    steps:
      - name: Event context
        env:
          EVENT: ${{ toJSON(github.event) }}
        run: |
          echo "$EVENT"
{
  "action": "published",
  "release": {
     ...
    "body": "Foo bar baz",
    "created_at": "2021-06-30T16:46:39Z",
    "draft": false,
    "name": "Release Test 2",
    "prerelease": false,
    "published_at": "2021-06-30T16:47:23Z",
    "tag_name": "release2",
    ...
  }
  ...
}

How do you create the release? I used the GitHub web interface and entered the tag name here:

image