Gets the commit SHA of the csswg-drafts repository main branch Returns the SHA from the GitHub API tree response
(client: &Client)
| 123 | /// |
| 124 | /// Returns the SHA from the GitHub API tree response |
| 125 | pub async fn get_csswg_commit_sha(client: &Client) -> Result<String> { |
| 126 | let text = fetch_cached(client, GITHUB_CSSWG_TREE_URL, "index.json").await?; |
| 127 | let v: Value = serde_json::from_str(&text)?; |
| 128 | let sha = v["sha"].as_str().ok_or_else(|| anyhow!("Failed to extract SHA from GitHub API response"))?.to_string(); |
| 129 | Ok(sha) |
| 130 | } |
| 131 | |
| 132 | /// Extracts directory paths from the GitHub API tree response |
| 133 | fn extract_tree_directories(tree_value: &Value) -> Result<Vec<String>> { |
no test coverage detected