Repository navigation
Allow configuring the plugin-git version for local backend clone - #7536
Merged
6543 merged 5 commits intoNov 11, 2026
Merged
Conversation
When plugin-git is not in $PATH, the local backend downloads it from GitHub. That download ignored the HTTP status, so an error page was saved, made executable and run, and the clone step failed with "exec format error". The binary was not checked against the release checksums. The version could not be pinned. Assets were matched with strings.Contains, so GOARCH=arm got the arm64 binary. Download from the release download URLs instead of going through the GitHub API. Build the asset name exactly from GOOS/GOARCH. Fail on non-200 responses. Check the binary against the release's checksums.txt before writing it to disk. Add WOODPECKER_BACKEND_LOCAL_PLUGIN_GIT_VERSION (default "latest") to pin the version.
6543
reviewed
Nov 10, 2026
Member
|
also I dont see any value in checking the checksumm because they arrive via the same channel ... so if one can taint/change the binary he can also change the checksum ... ... if we sign the releases at some point that would be a different storry :) |
Member
|
PS: i would redirect this pull th allow specify the git clone version ... |
Add WOODPECKER_BACKEND_LOCAL_PLUGIN_GIT_VERSION (default "latest") to choose which plugin-git release the local backend downloads when no plugin-git binary is found in $PATH. Drop the checksum verification: checksums.txt is served from the same release as the binary, so it adds no protection against a tampered release. This can be revisited once releases are signed. Also move pluginGitReleaseURL to the top of clone.go.
6543
reviewed
Nov 10, 2026
Contributor
|
Surge PR preview deployment was removed |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7536 +/- ##
==========================================
+ Coverage 66.40% 66.58% +0.18%
==========================================
Files 449 449
Lines 22478 22487 +9
==========================================
+ Hits 14926 14973 +47
+ Misses 7552 7514 -38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Find the release (latest or the configured version) through the GitHub API and pick the binary by OS/arch, so a missing version and a missing platform binary give separate errors. Match whole name parts so linux/arm no longer picks the arm64 binary.
6543
reviewed
Nov 10, 2026
6543
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
plugin-gitis not in$PATH, the local backend downloads it for the clone step. Until now it always used the latest release.This PR:
WOODPECKER_BACKEND_LOCAL_PLUGIN_GIT_VERSION(defaultlatest) so a specific release can be used, e.g.2.12.1releases/latestorreleases/tags/<version>) and picks the binary whose name contains the OS and architecture, so changes to file names don't break itlinux/armno longer pickslinux-arm64_plugin-gitThere is no checksum verification:
checksums.txtcomes from the same release as the binary, so it wouldn't catch a tampered release. Once releases are signed, signature verification can be added.Closes #7531