Skip to content

Implement Cursor AI assistance for PR and commit operations #139

Implement Cursor AI assistance for PR and commit operations

Implement Cursor AI assistance for PR and commit operations #139

Workflow file for this run

name: Code Quality
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches:
- main
# Set minimum permissions by default
permissions:
contents: read
jobs:
docker-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
security-scan:
runs-on: ubuntu-latest
timeout-minutes: 15
# Specify permissions needed for this job
permissions:
security-events: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: apostrophe-cms:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run Docker Scout scan
uses: docker/scout-action@v1
with:
command: cves
image: apostrophe-cms:test
sarif-file: docker-scan-results.sarif
only-severities: critical,high
- name: Upload scan results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: docker-scan-results.sarif
category: docker-scout
unit-tests:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create coverage directory
run: mkdir -p website/coverage
- name: Build app image
run: docker compose -f docker-compose.yml -f docker-compose.override.yml build
- name: Run tests
run: docker compose -f docker-compose.yml -f docker-compose.override.yml run --rm apostrophe npm run test -- --coverage
- name: Save coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: website/coverage/lcov.info
lint:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build app image
run: docker compose -f docker-compose.yml -f docker-compose.override.yml build
- name: Run lint
run: docker compose -f docker-compose.yml -f docker-compose.override.yml run --rm apostrophe npm run lint
sonarqube:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
needs: unit-tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@v1.1.0
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}