pub fn get_github_base_ref(base_ref_env: CIEnv) -> Option<String> {
        // make sure we're running in a CI environment
        if !base_ref_env.is_github_actions {
            return None;
        }

        /*
         * The name of the base ref or target branch of the pull request in a
         * workflow run.
         *
         * This variable only has a value when the event that triggers a workflow run
         * is either `pull_request` or `pull_request_target`.
         * For example, `main`
         *
         * So environment variable is empty in a regular commit
         */
        if let Ok(pr) = base_ref_env.github_base_ref {
            if !pr.is_empty() {
                return Some(pr);
            }
        }

        // we must be in a push event
        // try reading from the GITHUB_EVENT_PATH file
        if let Ok(event_path) = base_ref_env.github_event_path {
            // Try to open the event file and read the contents
            let data = fs::read_to_string(event_path).ok()?;

            // Parse the JSON data from the file
            let json: GitHubEvent = serde_json::from_str(&data).ok()?;

            // Extract the base ref from the pull request event if available
            let base_ref = &json.before;

            // the base_ref will be UNKNOWN_SHA on first push
            // we also use this behavior in force pushes
            if base_ref == UNKNOWN_SHA || json.forced {
                return json.get_parent_ref_of_first_commit();
            }

            if base_ref.is_empty() {
                return None;
            }

            return Some(base_ref.to_string());
        }
        None
    }
for GitHub Actions environment variables, see: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
crates/turborepo-scm/src/git.rs