Comments for static pages? - Part 2
Looking back… I need a bit of DIY GitHub API for Rust. Still step 2: Create a branch and PR automatically Thankfully, the V3 API is really simple. Using our tRusty language, we can define some structs to be serialized to JSON for requests: #[derive(Serialize)] struct CreateRef { r#ref: String, // The name to be used sha: String, // The commit SHA to point to } #[derive(Serialize)] struct CreateFile { message: String, content: String, branch: String, committer: UserRef, } #[derive(Serialize)] struct UserRef { name: String, email: String, } #[derive(Serialize)] struct CreatePR { title: String, head: String, // The branch to be merged base: String, // The target branch for the merge (ie. master) } The basic steps we want to do are described by these: ...