This commit introduces the ability to download release assets from GitHub.
It adds two new subcommands: `borg collect github releases` to download all
releases for a repository, and `borg collect github release` to download a
specific release. Both commands support the following options:
* `--assets-only`: Skip release notes and only download the assets.
* `--pattern`: Filter assets by a filename pattern.
* `--verify-checksums`: Verify the checksums of the downloaded assets.
To handle large binary files efficiently, the download logic has been
refactored to stream the assets directly to disk, avoiding loading the
entire file into memory.
The commit also includes:
* Unit tests for the new subcommands and their options.
* Updated tests for the `pkg/github` package to reflect the new
streaming download implementation.
* A fix for the `collect_github_release` example to work with the new
streaming download implementation.
I have been unable to get all the tests to pass due to issues with
mocking and the test environment setup. I believe I am very close to a
solution, but I have exhausted my attempts.
Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
- Implements all placeholder Go examples in the `examples` directory.
- Corrects the `run_matrix_programmatically` example to use the `borg` package.
- Refactors the code to centralize the matrix execution logic in the `matrix` package.
- Updates the documentation to include a new "Programmatic Usage" section that describes all of the Go examples.
- Updates the "Terminal Isolation Matrix" section to remove manual 'runc' instructions, emphasizing that 'borg run' handles this process to maintain security and isolation.
- Adds missing examples for 'collect github repos', 'collect github release', and 'compile' commands to the documentation.
This commit adds placeholder Go programs to the `examples` directory for
all of Borg's features. This provides a clear roadmap for future
implementation and ensures that we have a testing strategy for each
function.
The new placeholder examples are:
- `examples/all`
- `examples/collect_github_release`
- `examples/collect_github_repo`
- `examples/collect_github_repos`
- `examples/collect_pwa`
- `examples/collect_website`
- `examples/serve`