diff --git a/git-cliff-core/src/changelog.rs b/git-cliff-core/src/changelog.rs index 3a42697..06b77a2 100644 --- a/git-cliff-core/src/changelog.rs +++ b/git-cliff-core/src/changelog.rs @@ -430,13 +430,20 @@ impl<'a> Changelog<'a> { } } - /// Adds remote data (e.g. GitHub commits) to the releases. - pub fn add_remote_data(&mut self) -> Result<()> { - debug!("Adding remote data..."); + /// Adds information about the remote to the template context. + pub fn add_remote_context(&mut self) -> Result<()> { self.additional_context.insert( "remote".to_string(), serde_json::to_value(self.config.remote.clone())?, ); + Ok(()) + } + + /// Adds remote data (e.g. GitHub commits) to the releases. + pub fn add_remote_data(&mut self) -> Result<()> { + debug!("Adding remote data..."); + self.add_remote_context()?; + #[cfg(feature = "github")] let (github_commits, github_pull_requests) = if self.config.remote.github.is_set() { diff --git a/git-cliff/src/lib.rs b/git-cliff/src/lib.rs index f689b0e..ea8dcb2 100644 --- a/git-cliff/src/lib.rs +++ b/git-cliff/src/lib.rs @@ -535,7 +535,7 @@ pub fn run(mut args: Opt) -> Result<()> { Box::new(File::open(context_path)?) }; let mut changelog = Changelog::from_context(&mut input, &config)?; - changelog.add_remote_data()?; + changelog.add_remote_context()?; changelog } else { // Process the repositories.