Path A: Cloud-Hosted SCM (SaaS)
Before You Start
5
Copy script to central repository
6
Copy GitHub Actions workflow file to central repository
name: Lineaje AI Scan
on:
workflow_dispatch:
inputs:
source_repo:
description: "Repository to scan (owner/repo)"
required: true
branch:
description: "Branch to scan"
required: true
default: "main"
jobs:
lineaje-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout target repo
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.source_repo }}
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.GITHUB_TOKEN }}
path: target-repo
- name: Checkout scanner scripts
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: .lineaje-scanner
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install mcp
- name: Run Lineaje AI policy scan with fix PR
env:
LINEAJE_PAT_TOKEN: ${{ secrets.LINEAJE_PAT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TARGET_SHA=$(git -C target-repo rev-parse HEAD)
python .lineaje-scanner/scripts/gha_repo_scan_fix.py \
--source-path target-repo \
--repo "${{ github.event.inputs.source_repo }}" \
--branch "${{ github.event.inputs.branch }}" \
--head-sha "$TARGET_SHA" \
--create-fix-pr \
| tee scan_result.txt
- name: Publish scan result to job summary
if: always()
run: cat scan_result.txt >> $GITHUB_STEP_SUMMARYSet Up GitHub SaaS with GitHub Action
Before You Start
Setup
3
Step 3: Copy Script to Central Repository
4
Step 4: Copy GitHub Actions Workflow File to Central Repository
name: Lineaje AI Scan
on:
workflow_dispatch:
inputs:
source_repo:
description: "Repository to scan (owner/repo)"
required: true
branch:
description: "Branch to scan"
required: true
default: "main"
jobs:
lineaje-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout target repo
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.source_repo }}
ref: ${{ github.event.inputs.branch }}
token: ${{ secrets.GITHUB_TOKEN }}
path: target-repo
- name: Checkout scanner scripts
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: .lineaje-scanner
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install mcp
- name: Run Lineaje AI policy scan with fix PR
env:
LINEAJE_PAT_TOKEN: ${{ secrets.LINEAJE_PAT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TARGET_SHA=$(git -C target-repo rev-parse HEAD)
python .lineaje-scanner/scripts/gha_repo_scan_fix.py \
--source-path target-repo \
--repo "${{ github.event.inputs.source_repo }}" \
--branch "${{ github.event.inputs.branch }}" \
--head-sha "$TARGET_SHA" \
--create-fix-pr \
| tee scan_result.txt
- name: Publish scan result to job summary
if: always()
run: cat scan_result.txt >> $GITHUB_STEP_SUMMARYLast updated