Skip to content
Open

New #12

Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 68 additions & 4 deletions .github/workflows/ripple.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,59 @@
# This is the top-level name of your entire workflow
name: Ripple Enterprise Gate

# This defines WHEN the workflow runs
on:
pull_request:
types: [opened, synchronize, reopened]

# This defines the permissions the workflow has
permissions:
contents: read
pull-requests: read
checks: write

# THIS IS THE MISSING 'jobs:' KEY
jobs:
# This is your first job, correctly indented under 'jobs'
build-ripple-cli:
name: Build Ripple CLI
runs-on: ubuntu-latest
steps:
- name: Checkout Ripple Main Repo from Dev Branch
uses: actions/checkout@v4
with:
repository: raushankcode/ripple
ref: v13-test # Or your correct dev branch name
path: ripple-main
token: ${{ secrets.CROSS_REPO_PAT }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"

- name: Build and Pack Ripple CLI
working-directory: ./ripple-main
run: |
npm install
npm run build --workspaces
npm pack --workspace @getripple/core
npm pack --workspace @getripple/cli

- name: Upload CLI Artifact
uses: actions/upload-artifact@v4
with:
name: ripple-cli-packages
path: |
ripple-main/getripple-core-*.tgz
ripple-main/getripple-cli-*.tgz

# This is your second job, also correctly indented under 'jobs'
ripple-gate:
name: Ripple authorization gate
runs-on: ubuntu-latest
needs: build-ripple-cli

steps:
- name: Checkout PR Code
uses: actions/checkout@v4
Expand All @@ -22,16 +63,39 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: "22.x"

- name: Direct receipt test (bypasses CLI entirely)
run: |
SHA="${{ github.event.pull_request.head.sha || github.sha }}"
echo "Testing with SHA: $SHA"
RESULT=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$RIPPLE_CLOUD_URL/api/audit" \
-H "Authorization: Bearer $RIPPLE_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"protocol\":\"ripple-audit\",\"intentId\":\"ci-direct-${SHA:0:8}\",\"commitSha\":\"$SHA\",\"branch\":\"test\",\"actor\":\"direct-test\",\"source\":\"ci\",\"decision\":\"continue\",\"payload\":{\"test\":true}}")

echo "Direct audit API call returned HTTP status: $RESULT"

if [ "$RESULT" != "200" ]; then
echo "❌ Direct API call failed. This proves a problem with secrets, network, or the cloud API endpoint itself."
exit 1
fi

echo "✅ Direct API call succeeded. The connection to the cloud is healthy."
env:
RIPPLE_API_KEY: ${{ secrets.RIPPLE_API_KEY }}
RIPPLE_CLOUD_URL: ${{ secrets.RIPPLE_CLOUD_URL }}

- name: Download Ripple CLI Artifact
uses: actions/download-artifact@v4
with:
name: ripple-cli-packages

- name: Ripple CI gate
env:
RIPPLE_API_KEY: ${{ secrets.RIPPLE_API_KEY }}
RIPPLE_CLOUD_URL: ${{ secrets.RIPPLE_CLOUD_URL }}
run: |
# Install the local packages we copied into the repo
npm install ./getripple-core-*.tgz
npm install ./getripple-cli-*.tgz

# Run the gate using the now-installed binary
./node_modules/.bin/ripple ci --base origin/${{ github.base_ref || 'main' }} --github-annotations --sha ${{ github.event.pull_request.head.sha || github.sha }}
2 changes: 2 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
export function funcA(input: string): string {
// This is the function we plan to change.
return `Processed A: ${input}`;
//right change, love, new,test
}

export function funcB(input: string): string {
// This function should NOT be changed.
return `Processed B: ${input}`;
// outside change
}
Loading