`${{ runner.environment }}` can be `github-hosted` and `self-hosted`: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#runner-context. This should be enough to detect if a warning is needed.