Job.container.credentials doesn't work in main branch

Hi,

I tested a new workflow with a private docker image in a pull-request. I am supplying the credential via organization secrets.

  deploy_customer:
    runs-on: ubuntu-latest
    # needs:
    #   - build_container
    container:
      image: registry.example.org/repo/image:96e8953
      credentials:
        username: user
        password: ${{ secrets.REGISTRY_PASSWORD }}

When I merge the PR into our main brain, the credential stops working:

Starting job container
  /usr/bin/docker --config /home/runner/work/_temp/.docker_576998fd-5ad2-4214-84a0-b272ffe9e47a login registry.example.org -u user --password-stdin
  Error: Docker login for 'registry.example.org' failed with exit code 1

Can anyone help?