-
Notifications
You must be signed in to change notification settings - Fork 5
fix: validate zi repository identity before destructive git operations; automate checksum generation #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ss-o
merged 19 commits into
main
from
copilot/fix-install-script-destroying-untracked-work
Jul 24, 2026
Merged
fix: validate zi repository identity before destructive git operations; automate checksum generation #176
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
99ae80e
Initial plan
Copilot c880e47
fix: validate zi repository identity before destructive git operations
Copilot 2649df9
fix: address code review feedback on security validation
Copilot 1bcc948
fix: address remaining code review issues
Copilot 008ef76
fix: strengthen URL matching with exact case pattern instead of grep
Copilot 8cba7e3
fix: add clarity improvements from code review
Copilot a11f407
fix: clarify test double error message for remote subcommand validation
Copilot 900ba1d
chore: add automated checksum generation script and integrate into CI
Copilot 55f30fd
feat: automate checksum generation with generate-checksums.sh
Copilot 57ea5ef
refactor: address code review feedback - minor clarity improvements
Copilot 0b7c01b
refactor: address second code review round - inline _zi_remote, renam…
Copilot 83d3f57
Potential fix for pull request finding
ss-o 54365fe
Checksum 83d3f571cc95c3fb0f01073f18ecfc58a24d9235
digital-teams 3b724d0
Potential fix for pull request finding
ss-o e4737e4
fix: satisfy shellcheck in checksum generator
Copilot f3a62a2
fix: remove remaining shellcheck warning
Copilot 1606087
chore: refresh installer checksum
Copilot 404b6d8
test: clarify fake git remote errors
Copilot ed4776b
chore: address validation feedback
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| 0140801e80b2d8767e95d215850b6feab3642ee2b6fd70fbf4aab09afcfe7fca public/sh/install_zpmod.sh | ||
| 0cca0bb9f95101b4bf392d6aa3c23123602d99a7cbb0decacaa72973e016d89d public/sh/install.sh | ||
| f9d8ef697ba682bdfe66fdd67d4517caa4e62bb8baf2868ec8ed9932809b76aa public/sh/install.sh | ||
| 08cc893ceb982fc99d17db1966c6c30790cc571e16e4f5392352d995f5252952 public/sh/sync-init.sh | ||
| 5c7af31d7fc848d80f9fedf69c75e6844503f550a3d5e020bc7cdfdaca624763 public/zsh/init.zsh |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/usr/bin/env sh | ||
| # -*- mode: sh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- | ||
| # vim: ft=sh sw=2 ts=2 et | ||
| # | ||
| # generate-checksums.sh — regenerate public/checksum.txt | ||
| # | ||
| # Usage (from any directory): | ||
| # sh public/sh/generate-checksums.sh | ||
| # | ||
| # This script is also invoked by the CI workflows before running | ||
| # tests/installers.sh so that public/checksum.txt is always current. | ||
|
|
||
| set -eu | ||
|
|
||
| ROOT="$( | ||
| unset CDPATH | ||
| cd "$(dirname "$0")/../.." 2>/dev/null && pwd | ||
| )" || { printf '%s\n' "generate-checksums: cannot determine repository root" >&2; exit 1; } | ||
|
|
||
| CHECKSUM_FILE="${ROOT}/public/checksum.txt" | ||
|
|
||
| sha256_file() { | ||
| if command -v sha256sum >/dev/null 2>&1; then | ||
| sha256sum "$1" | awk '{print $1}' | ||
| elif command -v shasum >/dev/null 2>&1; then | ||
| shasum -a 256 "$1" | awk '{print $1}' | ||
| else | ||
| printf '%s\n' "generate-checksums: sha256sum or shasum is required" >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| # Clear (or create) the checksum file before writing fresh entries with `: > file`. | ||
| : > "${CHECKSUM_FILE}" | ||
| for f in \ | ||
| public/sh/install_zpmod.sh \ | ||
| public/sh/install.sh \ | ||
| public/sh/sync-init.sh \ | ||
| public/zsh/init.zsh | ||
| do | ||
| hash="$(sha256_file "${ROOT}/${f}")" | ||
| printf '%s %s\n' "${hash}" "${f}" >> "${CHECKSUM_FILE}" | ||
| done | ||
|
|
||
| printf '%s\n' "Checksums written to ${CHECKSUM_FILE}" | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.