Skip to main content

Downloading workflow artifacts

You can download archived artifacts before they automatically expire.

Qui peut utiliser cette fonctionnalité ?

People who are signed into GitHub and have read access to a repository can download workflow artifacts.

Tool navigation

By default, GitHub stores build logs and artifacts for 90 days, and you can customize this retention period, depending on the type of repository. For more information, see Gestion des paramètres de GitHub Actions pour un dépôt.

L’accès en lecture au dépôt est requis pour effectuer ces étapes.

  1. Sur GitHub, accédez à la page principale du référentiel.

  2. Sous le nom de votre dépôt, cliquez sur Actions.

    Capture d’écran des onglets du référentiel « github/docs ». L’onglet « Actions » est mis en surbrillance avec un encadré orange.

  3. Dans la barre latérale gauche, cliquez sur le workflow que vous souhaitez afficher.

    Capture d'écran de la barre latérale gauche de l'onglet « Actions », avec un workflow « CodeQL » indiqué en orange foncé.

  4. Dans la liste des exécutions de workflow, cliquez sur le nom de l’exécution pour voir le résumé de l’exécution du workflow.

  5. In the "Artifacts" section, click the artifact you want to download.

    Screenshot of the "Artifacts" section of a workflow run. The name of an artifact generated by the run, "artifact," is outlined in orange.

Remarque

Pour plus d’informations sur GitHub CLI, consultez À propos de GitHub CLI.

GitHub CLI will download each artifact into separate directories based on the artifact name. If only a single artifact is specified, it will be extracted into the current directory.

To download all artifacts generated by a workflow run, use the run download subcommand. Replace run-id with the ID of the run that you want to download artifacts from. If you don't specify a run-id, GitHub CLI returns an interactive menu for you to choose a recent run.

gh run download RUN_ID

To download a specific artifact from a run, use the run download subcommand. Replace run-id with the ID of the run that you want to download artifacts from. Replace artifact-name with the name of the artifact that you want to download.

gh run download RUN_ID -n ARTIFACT_NAME

You can specify more than one artifact.

gh run download RUN_ID> -n ARTIFACT_NAME-1 -n ARTIFACT_NAME-2

To download specific artifacts across all runs in a repository, use the run download subcommand.

gh run download -n ARTIFACT_NAME-1 ARTIFACT_NAME-2