From 3002d272736dacac7705fe03480192a2067219a0 Mon Sep 17 00:00:00 2001 From: Sander Declerck Date: Tue, 2 Dec 2025 13:58:27 +0100 Subject: [PATCH] Fix safe-chain in CI --- install-scripts/install-safe-chain.ps1 | 2 +- install-scripts/install-safe-chain.sh | 2 +- .../safe-chain/src/shell-integration/setup-ci.js | 13 ++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/install-scripts/install-safe-chain.ps1 b/install-scripts/install-safe-chain.ps1 index 1d2dab2..dcffe8a 100644 --- a/install-scripts/install-safe-chain.ps1 +++ b/install-scripts/install-safe-chain.ps1 @@ -19,7 +19,7 @@ param( [switch]$includepython ) -$Version = "v0.0.4-binaries-beta" +$Version = "v0.0.5-binaries-beta" $InstallDir = Join-Path $env:USERPROFILE ".safe-chain\bin" $RepoUrl = "https://github.com/AikidoSec/safe-chain" diff --git a/install-scripts/install-safe-chain.sh b/install-scripts/install-safe-chain.sh index a65aee9..fb7328d 100755 --- a/install-scripts/install-safe-chain.sh +++ b/install-scripts/install-safe-chain.sh @@ -23,7 +23,7 @@ set -e # Exit on error # Configuration -VERSION="${SAFE_CHAIN_VERSION:-v0.0.4-binaries-beta}" +VERSION="${SAFE_CHAIN_VERSION:-v0.0.5-binaries-beta}" INSTALL_DIR="${HOME}/.safe-chain/bin" REPO_URL="https://github.com/AikidoSec/safe-chain" diff --git a/packages/safe-chain/src/shell-integration/setup-ci.js b/packages/safe-chain/src/shell-integration/setup-ci.js index 9e0342d..28109fb 100644 --- a/packages/safe-chain/src/shell-integration/setup-ci.js +++ b/packages/safe-chain/src/shell-integration/setup-ci.js @@ -29,6 +29,7 @@ export async function setupCi() { ui.emptyLine(); const shimsDir = path.join(os.homedir(), ".safe-chain", "shims"); + const binDir = path.join(os.homedir(), ".safe-chain", "shims"); // Create the shims directory if it doesn't exist if (!fs.existsSync(shimsDir)) { fs.mkdirSync(shimsDir, { recursive: true }); @@ -36,7 +37,7 @@ export async function setupCi() { createShims(shimsDir); ui.writeInformation(`Created shims in ${shimsDir}`); - modifyPathForCi(shimsDir); + modifyPathForCi(shimsDir, binDir); ui.writeInformation(`Added shims directory to PATH for CI environments.`); } @@ -130,13 +131,18 @@ function createShims(shimsDir) { /** * @param {string} shimsDir + * @param {string} binDir * * @returns {void} */ -function modifyPathForCi(shimsDir) { +function modifyPathForCi(shimsDir, binDir) { if (process.env.GITHUB_PATH) { // In GitHub Actions, append the shims directory to GITHUB_PATH - fs.appendFileSync(process.env.GITHUB_PATH, shimsDir + os.EOL, "utf-8"); + fs.appendFileSync( + process.env.GITHUB_PATH, + shimsDir + os.EOL + binDir + os.EOL, + "utf-8" + ); ui.writeInformation( `Added shims directory to GITHUB_PATH for GitHub Actions.` ); @@ -147,6 +153,7 @@ function modifyPathForCi(shimsDir) { // ##vso[task.prependpath]/path/to/add // Logging this to stdout will cause the Azure Pipelines agent to pick it up ui.writeInformation("##vso[task.prependpath]" + shimsDir); + ui.writeInformation("##vso[task.prependpath]" + binDir); } }