mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Skeleton
This commit is contained in:
parent
9db8a2cc24
commit
3c18ad76f7
2 changed files with 31 additions and 0 deletions
23
README.md
23
README.md
|
|
@ -191,6 +191,7 @@ iex "& { $(iwr 'https://raw.githubusercontent.com/AikidoSec/safe-chain/main/inst
|
|||
|
||||
- ✅ **GitHub Actions**
|
||||
- ✅ **Azure Pipelines**
|
||||
- ✅ **CircleCI**
|
||||
|
||||
## GitHub Actions Example
|
||||
|
||||
|
|
@ -224,3 +225,25 @@ iex "& { $(iwr 'https://raw.githubusercontent.com/AikidoSec/safe-chain/main/inst
|
|||
```
|
||||
|
||||
After setup, all subsequent package manager commands in your CI pipeline will automatically be protected by Aikido Safe Chain's malware detection.
|
||||
|
||||
## CircleCI Example
|
||||
|
||||
```yaml
|
||||
version: 2.1
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: cimg/node:lts
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
curl -fsSL https://raw.githubusercontent.com/AikidoSec/safe-chain/main/install-scripts/install-safe-chain.sh | sh -s -- --ci
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
workflows:
|
||||
build_and_test:
|
||||
jobs:
|
||||
- build
|
||||
```
|
||||
|
||||
Note: `setup-ci` writes the Safe Chain shims to `~/.safe-chain/shims` and persists PATH via CircleCI's `BASH_ENV`, so subsequent steps automatically use the wrapped package managers.
|
||||
|
|
|
|||
|
|
@ -157,6 +157,14 @@ function modifyPathForCi(shimsDir, binDir) {
|
|||
ui.writeInformation("##vso[task.prependpath]" + shimsDir);
|
||||
ui.writeInformation("##vso[task.prependpath]" + binDir);
|
||||
}
|
||||
|
||||
if (process.env.BASH_ENV) {
|
||||
// In CircleCI, persisting PATH across steps is done by appending shell exports
|
||||
// to the file referenced by BASH_ENV. CircleCI sources this file for each step.
|
||||
const exportLine = `export PATH=\"${shimsDir}:${binDir}:$PATH\"` + os.EOL;
|
||||
fs.appendFileSync(process.env.BASH_ENV, exportLine, "utf-8");
|
||||
ui.writeInformation(`Added shims directory to BASH_ENV for CircleCI.`);
|
||||
}
|
||||
}
|
||||
|
||||
function getToolsToSetup() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue