Skip to content

Commit

Permalink
Switch to new artifact unblocker. closes #140
Browse files Browse the repository at this point in the history
  • Loading branch information
MCOfficer committed Apr 11, 2022
1 parent dfb9f79 commit 8b540fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
15 changes: 5 additions & 10 deletions src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,11 @@ pub fn get_pr(id: u16) -> Result<PR> {
))
}

#[derive(Deserialize, Debug)]
pub struct UnblockedArtifact {
pub url: String,
}

pub fn unblock_artifact_download(artifact_id: u32) -> Result<UnblockedArtifact> {
make_request(&format!(
"https://endlesssky.mcofficer.me/actions-artifacts/artifact/{}",
artifact_id
))
pub fn unblock_artifact_download(artifact_id: u32) -> String {
format!(
"https://artifact-unblocker.mcofficer.workers.dev/artifact/{}",
artifact_id,
)
}

#[derive(Deserialize, Debug)]
Expand Down
5 changes: 2 additions & 3 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ fn download_pr_asset(
let artifacts = get_workflow_run_artifacts(run.id)?;
let artifact = choose_artifact(artifacts, instance_type)?;

let unblocked = github::unblock_artifact_download(artifact.id)?;

let unblocked_url = github::unblock_artifact_download(artifact.id);
let archive_path = github::download(
instance_name,
&unblocked.url,
&unblocked_url,
&format!("{}.zip", artifact.name()),
destination,
)?;
Expand Down

0 comments on commit 8b540fa

Please sign in to comment.