Skip to content

Instantly share code, notes, and snippets.

@myoun
Created March 5, 2025 18:40
Show Gist options
  • Save myoun/8d97e5dcdf588884cbdd360b6bf9f3be to your computer and use it in GitHub Desktop.
Save myoun/8d97e5dcdf588884cbdd360b6bf9f3be to your computer and use it in GitHub Desktop.
get latest artifacts
import requests
owner = "carbonium-community"
repo = "carbonium-deploy"
workflow_name = "build_core"
runs_url = f"https://api.github.com/repos/{owner}/{repo}/actions/workflows/{workflow_name}.yml/runs?per_page=1&status=success"
runs_res= requests.get(runs_url).json()
latest_success = runs_res["workflow_runs"][0]
artifacts_url = latest_success["artifacts_url"]
artifacts_res = requests.get(artifacts_url)
print(artifacts_res.json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment