diff --git a/.github/workflows/ripple.yml b/.github/workflows/ripple.yml index 7408b1b..6317b0c 100644 --- a/.github/workflows/ripple.yml +++ b/.github/workflows/ripple.yml @@ -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 @@ -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 }} diff --git a/src/utils.ts b/src/utils.ts index 3a350b2..fcf3b5c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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 } \ No newline at end of file