phpgithubelectron-updater

How can i read a release file in GitHub in "raw" format


Concept: I want to have a PHP API that will detect the latest release number on github using latest.yml and download the correct executable file using the URL in the latest.yml file.

Right now I'm using electron builder + updater to create my latest releases and latest.yml files and therefore I need a way of getting the URL inside the yml file I know how to do this if the file was in a directory however I need a way of reading the file "raw" on GitHub however I'm not sure if I can do that with release files as https://raw.githubusercontent.com/futurelucas4502/management-console/releases/latest/latest.yml and https://raw.githubusercontent.com/futurelucas4502/management-console/releases/download/latest/latest.yml doesn't work


Solution

  • So I'm not sure if github has the ability to view "raw" release files however using PHP file_get_contents() works as intended and loads a "raw" version of the file without downloading. https://www.php.net/manual/en/function.file-get-contents.php