Set Job environment based on input or push event

On push I want to set jobs.Deploy.environment=dev
On workflow_dispatch I want to set jobs.Deploy.environment=<user input>

I then want to echo the environment used by the Job

name: Set Environment on push or workflow_dispatch

env:
  DEFAULT_ENVIRONMENT: dev

on:
  push:
    branches: [ main ]
  workflow_dispatch:
    inputs:
      environment:
        type: environment
        required: true

jobs:

  Deploy:
    runs-on: ubuntu-latest

    # ISSUE 1: fails with Unrecognized named-value: 'env'. Located at position 36 within expression: github.event.inputs.environment || env.DEFAULT_ENVIRONMENT
    environment: ${{ github.event.inputs.environment || env.DEFAULT_ENVIRONMENT }}

    steps:

      # ISSUE 2: this doesn't exist
      - name: Echo environment
        run: |
          echo "${{ github.environment }}"