fix(ci): bound opengrep installer downloads (#109089)

* fix(ci): bound opengrep installer downloads

* test(ci): tighten opengrep installer guard

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
thomas.szbay
2026-07-17 14:17:45 +08:00
committed by GitHub
parent ea6ed38e20
commit 44ab167200
3 changed files with 37 additions and 13 deletions
+7 -3
View File
@@ -38,9 +38,13 @@ jobs:
OPENGREP_VERSION: v1.22.0
OPENGREP_INSTALL_SHA: f458d7f0d52cc58eae1ca3cf3d5caf101e637519
run: |
curl -fsSL --connect-timeout 30 --max-time 120 \
"https://raw.githubusercontent.com/opengrep/opengrep/${OPENGREP_INSTALL_SHA}/install.sh" \
| bash -s -- -v "$OPENGREP_VERSION"
# Download first so a timed-out transfer cannot execute a partial installer.
installer="$(mktemp "${RUNNER_TEMP}/opengrep-install.XXXXXX")"
trap 'rm -f "$installer"' EXIT
curl -fsSL --connect-timeout 10 --max-time 120 \
-o "$installer" \
"https://raw.githubusercontent.com/opengrep/opengrep/${OPENGREP_INSTALL_SHA}/install.sh"
bash "$installer" -v "$OPENGREP_VERSION"
echo "$HOME/.opengrep/cli/latest" >> "$GITHUB_PATH"
- name: Verify opengrep
+7 -3
View File
@@ -64,9 +64,13 @@ jobs:
OPENGREP_VERSION: v1.22.0
OPENGREP_INSTALL_SHA: f458d7f0d52cc58eae1ca3cf3d5caf101e637519
run: |
curl -fsSL --connect-timeout 30 --max-time 120 \
"https://raw.githubusercontent.com/opengrep/opengrep/${OPENGREP_INSTALL_SHA}/install.sh" \
| bash -s -- -v "$OPENGREP_VERSION"
# Download first so a timed-out transfer cannot execute a partial installer.
installer="$(mktemp "${RUNNER_TEMP}/opengrep-install.XXXXXX")"
trap 'rm -f "$installer"' EXIT
curl -fsSL --connect-timeout 10 --max-time 120 \
-o "$installer" \
"https://raw.githubusercontent.com/opengrep/opengrep/${OPENGREP_INSTALL_SHA}/install.sh"
bash "$installer" -v "$OPENGREP_VERSION"
echo "$HOME/.opengrep/cli/latest" >> "$GITHUB_PATH"
- name: Verify opengrep