In GitHub Actions, treat workflow inputs/expressions as potentially unsafe and follow two rules: (1) avoid interpolating ${{ ... }} directly inside shell-script logic, and (2) do not persist Git credentials from checkout; instead, scope tokens to only the step that needs to push.
Apply it like this:
env: and using normal shell variable expansion with proper quoting.origin with the token only in that step (so other steps don’t inherit it).This reduces risk of template-driven code injection and prevents unnecessary credential exposure in the workflow environment.