Skip to content

Commit a9aa871

Browse files
KobzolMark-Simulacrum
authored andcommitted
Do not hardcode the default branch of the blog repository
1 parent c71b4de commit a9aa871

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ use tempfile::NamedTempFile;
3434

3535
const TARGET: &str = env!("TARGET");
3636

37-
const BLOG_PRIMARY_BRANCH: &str = "master";
38-
3937
struct Context {
4038
work: PathBuf,
4139
handle: Easy,
@@ -904,8 +902,9 @@ impl Context {
904902
};
905903

906904
let mut token = github.token(repository_for_blog)?;
905+
let blog_repo = token.repository()?;
907906
token.create_file(
908-
BLOG_PRIMARY_BRANCH,
907+
&blog_repo.default_branch,
909908
&format!(
910909
"posts/inside-rust/{}-{}-prerelease.md",
911910
chrono::Utc::now().date_naive().format("%Y-%m-%d"),

0 commit comments

Comments
 (0)