Skip to content

feat: ship issue-to-PR harness and execution cockpit #77

feat: ship issue-to-PR harness and execution cockpit

feat: ship issue-to-PR harness and execution cockpit #77

Workflow file for this run

# Loki CI - Quality Gate Example Workflow
# Add this to your repository's .github/workflows/ directory
# Runs Loki Mode quality gates on every pull request
#
# Prerequisites:
# - npm install -g loki-mode (or add to devDependencies)
# - GITHUB_TOKEN is available by default in GitHub Actions
name: Loki CI Quality Gate
on:
pull_request:
branches: [main, develop]
permissions:
contents: read
pull-requests: write # Required for --github-comment
concurrency:
group: loki-ci-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
quality-gate:
name: Loki Quality Gate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for accurate diff
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Loki Mode
run: npm install -g loki-mode
- name: Run Quality Gates
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: loki ci --pr --fail-on critical,high --format markdown
- name: Post PR Comment
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: loki ci --pr --github-comment --format github
# Optional: Test suggestions for changed files
test-suggestions:
name: Test Suggestions
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Loki Mode
run: npm install -g loki-mode
- name: Generate Test Suggestions
run: loki ci --test-suggest --format json
# Optional: Full JSON report as artifact
quality-report:
name: Quality Report
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Loki Mode
run: npm install -g loki-mode
- name: Generate Report
run: loki ci --report --format json > loki-ci-report.json
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: loki-ci-report
path: loki-ci-report.json
retention-days: 30