Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Download a repository archive

Aperta
#191 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
github, gitlab, typescript

Direzione di ricerca

Start by locating the implementation of forge.contents and releases.downloadAsset(), then trace how provider-specific requests and response streams are handled. Add forge.contents.archive(repo, { ref, format, as }) using the documented endpoints for GitHub, GitLab, and Gitea/Forgejo, and verify provider behavior with the relevant tests or test fixtures. Done means supported formats and binary/stream responses work consistently, while archive naming differences are documented.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

I would like to read files at one ref without running git. In GitHub, I fetch codeload.github.com/{repo}/tar.gz/{ref} directly, which only works for GitHub.

I'd like a contents.archive() that returns the archive the same way releases.downloadAsset() returns an asset:

    const stream = await forge.contents.archive(repo, { ref: 'main', format: 'tar.gz' })
    const bytes = await forge.contents.archive(repo, { ref: 'main', format: 'zip', as: 'binary' })

My agent said that these forges are supported:

  • GitHub: GET /repos/{owner}/{repo}/tarball/{ref} and /zipball/{ref}
    (redirects to codeload)
  • GitLab: GET /projects/:id/repository/archive.tar.gz?sha={ref}
  • Gitea and Forgejo: GET /repos/{owner}/{repo}/archive/{ref}.tar.gz
  • Bitbucket Cloud: as far as I can see there is no API endpoint, only the
    web URL /{workspace}/{repo}/get/{ref}.tar.gz

I am not sure about the name of archive: each forge names the top folder of the archive differently. I'd document that rather than rewrite the archive?

Happy to send a PR if this fits.

Lingua principale
TypeScript
Stelle
123
Fork
7
Merge medio
9h 15m
PR unite (30g)
188

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di danielroe/forges

Tutte le issue di danielroe/forges

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.