vault-action/scripts/.functions
Srikrishna Iyer 7e48e563b6
Some checks failed
/ build (push) Waiting to run
/ integrationOSS (push) Waiting to run
/ integrationEnterprise (push) Waiting to run
/ e2e (push) Waiting to run
/ e2e-tls (push) Waiting to run
Lint GitHub Actions Workflows / actionlint (push) Has been cancelled
Upgrade Node.js to 24 and update dependencies (#604)
* chore: upgrade Node.js to 24 and update dependencies

- Upgrade Node.js from 20 to 24.15.0 across all CI jobs and workflows
- Run npm audit fix to resolve CVEs in dependencies
- Generate TLS certs dynamically via scripts/gen-tls-certs.sh instead of using static certs
- Add Makefile targets for running each integration test suite locally

* add GOPATH/bin to PATH before running gen-tls-certs.sh

* Add changelog entry

* refactor makefile

* Refine e2e-enterprise pipeline and scripts
2026-05-12 10:21:00 +05:30

35 lines
908 B
Bash

#!/usr/bin/env bash
# Copyright IBM Corp. 2019, 2025
# SPDX-License-Identifier: MIT
# Adapted from: https://github.com/hashicorp/vault-secrets-operator/blob/main/hack/.functions
# getGH downloads files from GitHub with optional authentication
# Usage: getGH <url> [dest_file] [num_retries]
function getGH() {
local url="$1"
local dest="$2"
local num_retries="${3:-${GH_GET_RETRIES}}"
headers=(
'--header' "Accept: application/vnd.github+json"
'--header' "X-GitHub-Api-Version: 2022-11-28"
)
if [ -n "${GITHUB_TOKEN}" ]; then
headers+=(
'--header' "Authorization: Bearer ${GITHUB_TOKEN}"
)
fi
cmd=curl
opts=('-sfSL')
echo "Fetching ${url}"
if [ -z "${dest}" ]; then
opts+=('-O')
else
opts+=('-o' "${dest}")
fi
if [ -n "${num_retries}" ]; then
opts+=('--retry' "${num_retries}")
fi
${cmd} "${opts[@]}" "${headers[@]}" "${url}"
}