ci: Skip Nix for commits on release branches and tags (#37407)

Peter Tripp created

When doing stable/preview releases simultaneously there are two tags and
two branches pushed. Previously nix was attempting 1 job for each. Our
current mac parallelism is 4.
 
Can't easily test this. 🤷 

Release Notes:

- N/A

Change summary

.github/workflows/ci.yml | 1 +
1 file changed, 1 insertion(+)

Detailed changes

.github/workflows/ci.yml 🔗

@@ -81,6 +81,7 @@ jobs:
             echo "run_license=false" >> "$GITHUB_OUTPUT"
 
           echo "$CHANGED_FILES" | grep -qP '^(nix/|flake\.|Cargo\.|rust-toolchain.toml|\.cargo/config.toml)' && \
+            echo "$GITHUB_REF_NAME" | grep -qvP '^v[0-9]+\.[0-9]+\.[0-9x](-pre)?$' && \
             echo "run_nix=true" >> "$GITHUB_OUTPUT" || \
             echo "run_nix=false" >> "$GITHUB_OUTPUT"