This commit is contained in:
parent
872f20ed18
commit
73cb0c1eb7
|
@ -217,14 +217,15 @@ async fn get_previous_revision(
|
|||
config: &GiteaConfig,
|
||||
) -> color_eyre::eyre::Result<Revision> {
|
||||
let tags_url = format!(
|
||||
"https://{}/api/v1/repos/{}/{}/tags?page=1&limit=1",
|
||||
"https://{}/api/v1/repos/{}/{}/tags?page=1&limit=4",
|
||||
config.domain, config.owner, config.repo
|
||||
);
|
||||
let tags_response = client.get(tags_url).send().await?;
|
||||
|
||||
let mut tags: Vec<GiteaTagResponse> = tags_response.json().await?;
|
||||
let tags: Vec<GiteaTagResponse> = tags_response.json().await?;
|
||||
|
||||
let revision = if let Some(tag) = tags.pop() {
|
||||
let revision = if let Some(tag) = tags.get(0) {
|
||||
tracing::info!("tag: {}", tag.name);
|
||||
tag.name.parse()?
|
||||
} else {
|
||||
Revision::default()
|
||||
|
@ -292,6 +293,7 @@ async fn run() -> color_eyre::eyre::Result<()> {
|
|||
|
||||
let version_string = check_project(config.project).await?;
|
||||
|
||||
tracing::info!("Previous revision: {}", previous_revision);
|
||||
let revision = previous_revision.next(version_string);
|
||||
tracing::info!("New revision: {}", revision);
|
||||
|
||||
|
|
Loading…
Reference in a new issue