This commit is contained in:
parent
872f20ed18
commit
73cb0c1eb7
1 changed files with 5 additions and 3 deletions
|
@ -217,14 +217,15 @@ async fn get_previous_revision(
|
||||||
config: &GiteaConfig,
|
config: &GiteaConfig,
|
||||||
) -> color_eyre::eyre::Result<Revision> {
|
) -> color_eyre::eyre::Result<Revision> {
|
||||||
let tags_url = format!(
|
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
|
config.domain, config.owner, config.repo
|
||||||
);
|
);
|
||||||
let tags_response = client.get(tags_url).send().await?;
|
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()?
|
tag.name.parse()?
|
||||||
} else {
|
} else {
|
||||||
Revision::default()
|
Revision::default()
|
||||||
|
@ -292,6 +293,7 @@ async fn run() -> color_eyre::eyre::Result<()> {
|
||||||
|
|
||||||
let version_string = check_project(config.project).await?;
|
let version_string = check_project(config.project).await?;
|
||||||
|
|
||||||
|
tracing::info!("Previous revision: {}", previous_revision);
|
||||||
let revision = previous_revision.next(version_string);
|
let revision = previous_revision.next(version_string);
|
||||||
tracing::info!("New revision: {}", revision);
|
tracing::info!("New revision: {}", revision);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue