[PR #330] [CLOSED] Add utility functions for processing Github releases #2562

Closed
opened 2026-02-05 05:02:06 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE/pull/330
Author: @newzealandpaul
Created: 11/18/2024
Status: Closed

Base: mainHead: nzp-github-release


📝 Commits (2)

  • 24a7149 Adds utility functions to download the latest release of a project from github and untars it. Uses curls and standard gnu tools.
  • 84e5faf Simplified functions, as per the feedback, also use only wget

📊 Changes

1 file changed (+20 additions, -0 deletions)

View changed files

📝 misc/install.func (+20 -0)

📄 Description

Note

We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged.

Description

Many scripts download github releases. This PR adds two utility functions:

download_latest_github_release(user, repo) downloads the latest release and returns (echos) the filename. It relies on the github HTTP API.

extract_github_tarball(tarball, directory) untars a github release into target directory (this is regardless of how the release is named).

This could be used to fix issue #321.

Because this modifies install.func it should be considered high risk.

These functions can be easily test, for example:

#!/bin/sh
source misc/install.func
color
downloaded_file=$(download_latest_github_release BurntSushi ripgrep)
extract_github_tarball $downloaded_file release

Type of change

Please check the relevant option(s):

  • Bug fix (non-breaking change that resolves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would cause existing functionality to change unexpectedly)
  • New script (a fully functional and thoroughly tested script or set of scripts.)

Prerequisites

The following efforts must be made for the PR to be considered. Please check when completed:

  • Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions)
  • Testing performed (I have tested my changes, ensuring everything works as expected)
  • Documentation updated (I have updated any relevant documentation)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE/pull/330 **Author:** [@newzealandpaul](https://github.com/newzealandpaul) **Created:** 11/18/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `nzp-github-release` --- ### 📝 Commits (2) - [`24a7149`](https://github.com/community-scripts/ProxmoxVE/commit/24a71497943c85f43e7516cded2fc778cccd502e) Adds utility functions to download the latest release of a project from github and untars it. Uses curls and standard gnu tools. - [`84e5faf`](https://github.com/community-scripts/ProxmoxVE/commit/84e5fafd0d0dbe9bd3940d8f47a10c2e23f9dbd3) Simplified functions, as per the feedback, also use only wget ### 📊 Changes **1 file changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `misc/install.func` (+20 -0) </details> ### 📄 Description > [!NOTE] > We are meticulous when it comes to merging code into the main branch, so please understand that we may reject pull requests that do not meet the project's standards. It's never personal. Also, game-related scripts have a lower chance of being merged. ## Description Many scripts download github releases. This PR adds two utility functions: **download_latest_github_release**(user, repo) downloads the latest release and returns (echos) the filename. It relies on the github HTTP API. **extract_github_tarball**(tarball, directory) untars a github release into target directory (this is regardless of how the release is named). This could be used to fix issue #321. Because this modifies install.func it should be considered high risk. These functions can be easily test, for example: ``` #!/bin/sh source misc/install.func color downloaded_file=$(download_latest_github_release BurntSushi ripgrep) extract_github_tarball $downloaded_file release ``` ## Type of change Please check the relevant option(s): - [ ] Bug fix (non-breaking change that resolves an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (a fix or feature that would cause existing functionality to change unexpectedly) - [ ] New script (a fully functional and thoroughly tested script or set of scripts.) ## Prerequisites The following efforts must be made for the PR to be considered. Please check when completed: - [x] Self-review performed (I have reviewed my code, ensuring it follows established patterns and conventions) - [x] Testing performed (I have tested my changes, ensuring everything works as expected) - [x] Documentation updated (I have updated any relevant documentation) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 05:02:06 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#2562