Skip to content

Make use_github_file() more general #1782

Open

Description

@jennybc

As it stands, we've built-in the assumption that we're dealing with a plain text file, but I don't see why it should be limited to that.

Activity

  1. added
    git
    on Mar 4, 2023
  2. added
    feature
    on Nov 3, 2023
  3. added this to the Backlog milestone on Jul 30, 2025
  4. added
    help wanted ❤️
    tidy-dev-day 🤓
    on Jul 30, 2025
  5. ateucher commented on Sep 19, 2025

    @ateucher
    Collaborator

    Currently text files are saved to a tempfile, then read with read_utf8() and written to the final destination with write_over(), presumably to ensure the file has utf8 enconding (and maybe normalize line endings?).

    For non-text files, we should just copy the downloaded file to its final destination.

    The github contents API (https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content) doesn't appear to give the MIME type of the file, so we need to figure it out ourselves. I am going to use mime::guess_mime_type() to get started, even though it adds a new dependency.

  6. self-assigned this
    on Sep 19, 2025
  7. added a commit that references this issue on Sep 19, 2025
    fdf7f9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featuregithelp wanted ❤️tidy-dev-day 🤓

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions