Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7a5a262
SC-5146:Update semgrep.yml
Revanthathreya Feb 24, 2025
bca7793
Merge pull request #162 from skyflowapi/Revanthathreya-patch-4
skyflow-vivek Feb 26, 2025
d0caa7b
SC-5790:Create Gitleaks.yml
Revanthathreya Jun 10, 2025
791aa7c
SC-5790:Update and rename customRule.yml to gitleaks.toml
Revanthathreya Jun 10, 2025
a723331
SC-5790:Rename .github/Gitleaks.yml to .github/workflows/Gitleaks.yml
Revanthathreya Jun 10, 2025
4e9e454
Merge pull request #175 from skyflowapi/Revanthathreya-patch-4
skyflow-bharti Jun 11, 2025
eb1336d
Merge pull request #193 from skyflowapi/skyflow-vivek/SK-2259-immutab…
skyflow-vivek Aug 27, 2025
ffcacfa
SK-2276: update common module version to 1.0.1 (#215)
saileshwar-skyflow Sep 2, 2025
fe2037e
Merge pull request #216 from skyflowapi/v3-release/25.9.2
skyflow-bharti Sep 2, 2025
ce89552
[AUTOMATED] Public Release - 3.0.0-beta.3
saileshwar-skyflow Sep 2, 2025
b5b3ce4
SK-2283 Add README and Samples
skyflow-vivek Sep 5, 2025
97622b5
Merge pull request #219 from skyflowapi/skyflow-vivek/SK-2283-add-rea…
skyflow-vivek Sep 5, 2025
e702815
SK-2283 Add auth section content
skyflow-vivek Sep 8, 2025
bb87aa9
Merge pull request #221 from skyflowapi/beta-release/25.9.1
skyflow-vivek Sep 8, 2025
b03c677
SK-2286 V3 release/25.9.3 (#224)
skyflow-shravan Sep 9, 2025
ad33628
SK-2286 override vault url and accept skyflow creds from env (#225)
skyflow-shravan Sep 9, 2025
61d26c7
SK-2289 Fix upsert operation not working issue
skyflow-vivek Sep 10, 2025
d3257dc
Merge pull request #226 from skyflowapi/skyflow-vivek/SK-2289-fix-ups…
skyflow-vivek Sep 10, 2025
6f23911
[AUTOMATED] Private Release 2.0.0-beta.4-dev-d3257dc
skyflow-vivek Sep 10, 2025
04d886d
SK-2286 Update branch with latest code (#229)
skyflow-shravan Sep 11, 2025
b50c410
SK-2292 Update default concurrency limit from 10 to 1
skyflow-vivek Sep 11, 2025
33f6d97
SK-2292 fix unit tests
skyflow-bharti Sep 11, 2025
082387d
SK-2292 fix log in detokenize
skyflow-bharti Sep 11, 2025
d7908d1
SK-2292 fix log in detokenize
skyflow-bharti Sep 11, 2025
a25231a
Merge branch 'v3-release/25.9.5' into skyflow-vivek/SK-2292-update-de…
skyflow-bharti Sep 11, 2025
8e725b7
Merge pull request #232 from skyflowapi/skyflow-vivek/SK-2292-update-…
skyflow-bharti Sep 11, 2025
0186972
[AUTOMATED] Private Release 2.0.0-dev-8e725b7
skyflow-bharti Sep 11, 2025
e96d8dc
Merge branch 'v3-release/25.9.2' into v3-release/25.9.5
skyflow-bharti Sep 11, 2025
ff60830
[AUTOMATED] Private Release 2.0.0-dev-e96d8dc
skyflow-bharti Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/Gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Gitleaks secrets scan

on:
pull_request:
branches:
- main


permissions:
issues: write
pull-requests: write
contents: read

jobs:
gitleaks:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to get full commit history for diffing


- name: Get base and head commit SHAs
run: |
echo "BASE_SHA=${{ github.event.pull_request.base.sha }}" >> $GITHUB_ENV
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV


- name: Run Gitleaks on PR changes via Docker
run: |
docker run --rm -v $(pwd):/repo -w /repo zricethezav/gitleaks:latest detect \
--config="/repo/Rule/gitleaks.toml" \
--log-opts="--no-merges $BASE_SHA..$HEAD_SHA" \
--verbose \
--exit-code=0 \
--report-format=json \
--report-path="/repo/gitleaks-report.json" \
--redact

- name: Upload Gitleaks report
uses: actions/upload-artifact@v4
with:
name: gitleaks-report
path: gitleaks-report.json

- name: Format and comment findings on PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ! -f gitleaks-report.json ]; then
echo "Report file not found!"
exit 1
fi

FINDINGS_JSON=$(cat gitleaks-report.json)
COUNT=$(echo "$FINDINGS_JSON" | jq 'length')
SHA="${{ github.event.pull_request.head.sha }}"
REPO="${{ github.repository }}"
PR_NUMBER="${{ github.event.pull_request.number }}"
MAX=10

if [ "$COUNT" -gt 0 ]; then
COMMENT="**🔐 Gitleaks Findings: $COUNT issue(s) detected**\n\n"
i=0
while [ "$i" -lt "$COUNT" ] && [ "$i" -lt "$MAX" ]; do
ITEM=$(echo "$FINDINGS_JSON" | jq ".[$i]")
RULE=$(echo "$ITEM" | jq -r '.RuleID')
DESC=$(echo "$ITEM" | jq -r '.Description')
FILE=$(echo "$ITEM" | jq -r '.File')
LINE=$(echo "$ITEM" | jq -r '.Line')
LINK="https://github.com/$REPO/blob/$SHA/$FILE#L$LINE"
SECRET_MASKED="**********"
COMMENT+="🔸 **Rule**: \`$RULE\`\n"
COMMENT+="📄 **File**: \`$FILE:$LINE\`\n"
COMMENT+="📝 **Description**: $DESC\n"
COMMENT+="🔑 **Secret**: \`$SECRET_MASKED\`\n"
COMMENT+="🔗 **Path**: [$FILE:$LINE]($LINK)\n\n"
i=$((i + 1))
done

if [ "$COUNT" -gt "$MAX" ]; then
COMMENT+="...and more. Only showing first $MAX findings.\n"
fi
else
COMMENT="✅ **Gitleaks Findings:** No secrets detected. Safe to proceed!"
fi

# Escape newlines for GitHub API
COMMENT=$(echo "$COMMENT" | sed ':a;N;$!ba;s/\n/\\n/g')

curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"body\":\"$COMMENT\"}" \
"https://api.github.com/repos/${REPO}/issues/${PR_NUMBER}/comments"
63 changes: 46 additions & 17 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,64 @@
name: Semgrep
name: Semgrep Scan

# Run workflow each time code is pushed to your repository.
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
permissions:
pull-requests: write # Give write permission to PRs
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Semgrep
run: pip install semgrep
- name: Install Semgrep and jq
run: |
sudo apt install python3-venv jq
python3 -m venv .venv
.venv/bin/pip install semgrep

- name: Run Semgrep
run: |
semgrep --config .semgreprules/customRule.yml --config auto --severity ERROR --sarif . > results.sarif
source .venv/bin/activate
semgrep --config auto --severity ERROR --json-output=results.json --no-error
cat results.json | jq .results > pretty-results.json

- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
- name: Display Raw Semgrep JSON Output
run: |
echo "Displaying raw Semgrep results..."
cat pretty-results.json

- name: Add comment on PR if findings are found
uses: actions/github-script@v6
with:
# Path to SARIF file relative to the root of the repository
sarif_file: results.sarif
script: |
// Ensure the context has a pull_request
if (context.payload.pull_request) {
const prNumber = context.payload.pull_request.number;
const fs = require('fs');
const results = JSON.parse(fs.readFileSync('pretty-results.json', 'utf8'));
const highFindings = results.filter(result => result.extra && result.extra.severity === 'ERROR');

- name: Upload results
uses: actions/upload-artifact@v4
with:
name: semgrep-results
path: results.sarif
// Comment if findings exist
if (highFindings.length > 0) {
const comment = `**Semgrep Findings:** Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.`;
await github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
body: comment
});
} else {
const noIssuesComment = "**Semgrep findings:** No issues found, Good to merge.";
await github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
body: noIssuesComment
});
}
} else {
console.log("This workflow wasn't triggered by a pull request, so no comment will be added.");
}
30 changes: 0 additions & 30 deletions .semgreprules/customRule.yml

This file was deleted.

Loading