Skip to main content
This page provides detailed documentation for all reusable workflows and actions available from backbase-common/gc-ai-workflows that are used in Agentic AI platform CI/CD pipelines.

Overview

The gc-ai-workflows repository provides standardized, reusable GitHub Actions workflows and actions for Python AI/ML projects using uv for package management. These components ensure consistency across all agent projects.
[!IMPORTANT] Always use secrets: inherit when calling reusable workflows to pass secrets to the called workflow.

Reusable Workflows

Build and Publish

A comprehensive workflow that builds Docker images, runs quality checks, performs security scanning, and publishes to Azure Container Registry. Workflow: backbase-common/gc-ai-workflows/.github/workflows/build-publish.yaml@main

Usage

jobs:
  build:
    uses: backbase-common/gc-ai-workflows/.github/workflows/build-publish.yaml@main
    secrets: inherit
    with:
      timeout: 600
      enableSonar: true
      enablePromptfoo: true
      stableAcr: "my-acr"

Input Parameters

ParameterDescriptionDefault
timeoutWorkflow timeout in minutes600
pythonVersionPython version to use3.x
sourcePathSource path for code quality checkssrc/
enableSonarEnable SonarCloud analysistrue
sonarHostUrlSonarCloud host URLhttps://sonarcloud.io
stableAcrAzure ACR name on stable clustercragbs508
enablePromptfooEnable promptfoo evaluationtrue
promptfooConfigPath to promptfoo config filepromptfooconfig.yaml
enableRedteamEnable promptfoo redteamingtrue
redteamConfigPath to redteam config fileredteam.yaml
redteamNumTestsNumber of redteam tests to run5

Output Parameters

  • image: Full Docker image reference

Workflow Steps

  1. Setup project environment
  2. Check action SHA pinning
  3. Code quality checks (pylint, pytest, hadolint)
  4. Optional: Setup and run Promptfoo evaluation
  5. Optional: Run Promptfoo redteaming
  6. Optional: Run SonarCloud analysis
  7. Build Docker image
  8. Security check (Trivy image scan)
  9. Push Docker image to Azure ACR

Pull Request Check

A comprehensive validation workflow for pull requests that runs code quality checks, tests, security scans, and optional promptfoo evaluations. Workflow: backbase-common/gc-ai-workflows/.github/workflows/pull-request-check.yaml@main

Usage

jobs:
  verify:
    uses: backbase-common/gc-ai-workflows/.github/workflows/pull-request-check.yaml@main
    secrets: inherit
    with:
      enableSonar: true
      enablePromptfoo: true
      promptfooConfig: "promptfoo_config/*.yaml"
      enableRedteam: true

Input Parameters

ParameterDescriptionDefault
refGitHub reference (branch/tag)${{ github.ref }}
timeoutWorkflow timeout in minutes600
pythonVersionPython version to use3.x
sourcePathSource path for code quality checkssrc/
enableSonarEnable SonarCloud analysistrue
sonarHostUrlSonarCloud host URLhttps://sonarcloud.io
enablePromptfooEnable promptfoo evaluationtrue
promptfooConfigPath to promptfoo config filepromptfooconfig.yaml
enableRedteamEnable promptfoo redteamingtrue
redteamConfigPath to redteam config fileredteam.yaml
redteamNumTestsNumber of redteam tests to run5

Workflow Steps

  1. Setup project environment
  2. Check action SHA pinning
  3. Code quality checks (pylint, pytest, hadolint)
  4. Optional: Setup and run Promptfoo evaluation
  5. Optional: Run Promptfoo redteaming
  6. Optional: Run SonarCloud analysis
  7. Security check (filesystem scan)

Reusable Actions

Setup Project

Sets up the Python project environment, including checkout, Python installation, uv setup, dependency installation, and version resolution. Action: backbase-common/gc-ai-workflows/setup-project@main

Usage

- uses: backbase-common/gc-ai-workflows/setup-project@main
  id: setup-project
  with:
    pythonVersion: "3.x"
    githubPrivateKey: ${{ secrets.GIT_GITHUB_APP_PEM_FILE }}
    githubAppId: ${{ secrets.GIT_GITHUB_APP_ID }}

Input Parameters

ParameterDescriptionDefault
refGitHub reference (branch/tag)${{ github.ref }}
pythonVersionPython version to use3.x
githubPrivateKeyGitHub App private key (PEM)Required
githubAppIdGitHub App IDRequired
fetchDepthNumber of commits to fetch (0 = all)1
gitUsernameGit username for commitsbaasbot-ecos_backbase
gitEmailGit email for commits[email protected]

Output Parameters

  • version: Raw version from uv version
  • releaseVersion: Release version (without dev/alpha/beta/rc)
  • nextVersion: Next version (incremented patch with .dev0)
  • devVersion: Development version with branch and commit info
  • buildVersion: Build version (release or dev)
  • isStable: Whether this is a stable version
  • major, minor, patch: Version components
  • name: Project name from git repository
  • projectKey: Sonar project key
  • organization: GitHub organization
  • githubToken: Generated GitHub App token

Code Quality

Runs code quality checks including pylint, pytest, and hadolint. Action: backbase-common/gc-ai-workflows/code-quality@main

Usage

- uses: backbase-common/gc-ai-workflows/code-quality@main
  with:
    sourcePath: "src/"

Input Parameters

ParameterDescriptionDefault
sourcePathPath to source code for pylintsrc/
runPylintWhether to run pylinttrue
runTestsWhether to run teststrue
runHadolintWhether to run hadolint on Dockerfiletrue
dockerfilePathPath to DockerfileDockerfile

Sonar Check

Runs SonarCloud analysis on Python projects. Action: backbase-common/gc-ai-workflows/sonar-check@main

Usage

- uses: backbase-common/gc-ai-workflows/sonar-check@main
  with:
    sonarToken: ${{ secrets.SONAR_TOKEN }}
    projectName: ${{ steps.setup-project.outputs.name }}
    projectKey: ${{ steps.setup-project.outputs.projectKey }}
    organization: ${{ steps.setup-project.outputs.organization }}

Input Parameters

ParameterDescriptionDefault
sonarTokenSonarCloud authentication tokenRequired
sonarHostUrlSonarCloud host URLhttps://sonarcloud.io
projectNameProject nameRequired
projectKeySonar project keyRequired
organizationGitHub organizationRequired
coverageReportPathsComma-separated coverage report pathscoverage.xml

Security Check

Performs security checks of artifact dependencies and Docker images with Trivy vulnerability scanner. Action: backbase-common/gc-ai-workflows/security-check@main

Usage

# Filesystem scan
- uses: backbase-common/gc-ai-workflows/security-check@main
  with:
    scanType: "fs"
    severities: "CRITICAL,HIGH"

# Image scan
- uses: backbase-common/gc-ai-workflows/security-check@main
  with:
    scanType: "image"
    imageReference: "${{ steps.build-image.outputs.image }}"
    ignore: "CVE-2024-28752,CVE-2023-7272"

Input Parameters

ParameterDescriptionDefault
sbomPathPath to produced SBOMbom.json
scanTypeType: image or fsfs
scanReferenceFilesystem reference to scan.
imageReferenceContainer image name to scan(empty)
ignoreUnfixedVulnerabilitiesSkip unfixed vulnerabilitiestrue
severitiesSeverities to scan forCRITICAL
hideProgressHide scanning progresstrue
outputFormatTrivy output formatsarif
debugPrint scanner resultsfalse
exitCodeExit code on error0
trivyignorePathPath to Trivy ignore list./.trivyignore
ignoreComma-separated CVEs to ignoreCVE-2024-28752

Output Parameters

  • sbomPath: Path to generated SBOM

Promptfoo Evaluation

Runs promptfoo evaluation against agent endpoints. Only runs if promptfoo config files have changed. Action: backbase-common/gc-ai-workflows/promptfoo-evaluation@main
[!TIP] See the Promptfoo Configuration section for detailed setup instructions, including provider files, prompt functions, and test configuration.

Usage

- uses: backbase-common/gc-ai-workflows/promptfoo-evaluation@main
  with:
    config: "promptfoo_config.yaml"
    aiGatewayEndpoint: ${{ secrets.AI_GATEWAY_ENDPOINT }}
    aiGatewayApiKey: ${{ secrets.AI_GATEWAY_API_KEY }}
    githubToken: ${{ steps.setup-project.outputs.githubToken }}

Input Parameters

ParameterDescriptionDefault
configPath to promptfoo config filepromptfooconfig.yaml
aiGatewayEndpointAI Gateway endpoint URLRequired
aiGatewayApiKeyAI Gateway API keyRequired
githubTokenGitHub token for PR commentsRequired

Promptfoo Redteaming

Runs promptfoo redteaming evaluation against a local FastAPI server. Action: backbase-common/gc-ai-workflows/promptfoo-redteaming@main
[!TIP] See the Redteam Configuration section for detailed setup instructions, including redteam.yaml structure, plugins, and testing configuration.

Usage

- uses: backbase-common/gc-ai-workflows/promptfoo-redteaming@main
  with:
    redteamConfig: "redteam.yaml"
    redteamNumTests: "10"
    aiGatewayEndpoint: ${{ secrets.AI_GATEWAY_ENDPOINT }}
    aiGatewayApiKey: ${{ secrets.AI_GATEWAY_API_KEY }}
    githubToken: ${{ steps.setup-project.outputs.githubToken }}

Input Parameters

ParameterDescriptionDefault
redteamConfigPath to redteam config fileredteam.yaml
redteamNumTestsNumber of redteam tests to run5
aiGatewayEndpointAI Gateway endpoint URLRequired
aiGatewayApiKeyAI Gateway API keyRequired
githubTokenGitHub token for PR commentsRequired

Build Docker Image

Builds Docker images locally without pushing to a registry. Use this before running security checks. Action: backbase-common/gc-ai-workflows/build-docker@main

Usage

- uses: backbase-common/gc-ai-workflows/build-docker@main
  id: build-image
  with:
    acrName: "my-acr"
    projectName: ${{ steps.setup-project.outputs.name }}
    buildVersion: ${{ steps.setup-project.outputs.buildVersion }}

Input Parameters

ParameterDescriptionDefault
acrNameAzure ACR name (for image naming)Required
projectNameProject name from resolve-metadataRequired
buildVersionBuild version from resolve-metadataRequired
imageGroupImage group/namespace in ACRimages

Output Parameters

  • image: Full Docker image reference

Push Docker Image

Pushes Docker images to Azure Container Registry. Use this after building and running security checks. Action: backbase-common/gc-ai-workflows/push-docker@main

Usage

- uses: backbase-common/gc-ai-workflows/push-docker@main
  with:
    acrName: "my-acr"
    azureCredentials: ${{ secrets.GC_NPA_AZURE_CREDENTIALS }}
    image: ${{ steps.build-image.outputs.image }}

Input Parameters

ParameterDescriptionDefault
acrNameAzure ACR nameRequired
azureCredentialsAzure credentials secret (JSON)Required
imageFull Docker image reference to pushRequired

Create Release Draft

Prepares release draft by merging branches, updating versions, creating tags, and generating release notes using release-drafter. Action: backbase-common/gc-ai-workflows/create-release-draft@main
[!NOTE] Requires .github/release-drafter.yml configuration file.

Usage

- uses: backbase-common/gc-ai-workflows/create-release-draft@main
  with:
    baseBranch: "develop"
    headBranch: "main"
    githubToken: ${{ steps.setup-project.outputs.githubToken }}

Input Parameters

ParameterDescriptionDefault
baseBranchGit base branch to run release fromdevelop
headBranchDestination (head) git branchmain
githubTokenGitHub token from setup-projectRequired

Output Parameters

  • releaseVersion: Result release version

Provision Python Project

Provisions a Python project template by updating pyproject.toml with the correct package name, version, description, and URLs. Also creates initial CHANGELOG.md and README.md files. Action: backbase-common/gc-ai-workflows/provision-python-project@main

Usage

- uses: backbase-common/gc-ai-workflows/provision-python-project@main
  with:
    githubToken: ${{ steps.setup-project.outputs.githubToken }}
    packageName: ${{ github.event.repository.name }}
    packageVersion: "0.1.0.dev0"

Input Parameters

ParameterDescriptionDefault
githubTokenAccess token to manage GitHub repositoriesRequired
packageNamePackage name for pyproject.tomlRequired
packageVersionPackage version for pyproject.toml0.1.0.dev0
pyprojectPathPath to pyproject.toml file.
baseBranchGit base branch for provisioningdevelop
mainBranchMain branch to createmain

What It Does

  1. Updates pyproject.toml with package name, version, description, and URLs
  2. Regenerates uv.lock file
  3. Creates CHANGELOG.md with initial version entry
  4. Creates/updates README.md with build badges and SonarCloud integration
  5. Commits and pushes all changes to both base and main branches

Validate Pull Request Body

Validates pull request body description and content against the PR template. Action: backbase-common/gc-ai-workflows/validate-pull-request-body@main
[!NOTE] Requires .github/pull_request_template.md file.

Usage

- uses: backbase-common/gc-ai-workflows/validate-pull-request-body@main
  with:
    githubToken: ${{ secrets.GITHUB_TOKEN }}

Input Parameters

ParameterDescriptionDefault
githubTokenAccess token to manage GitHub repositoriesRequired

Check Action SHA Pinning

Validates that external GitHub Actions are pinned to SHA versions for security.
[!IMPORTANT] This action will not raise an exception in default configuration and validates actions and workflows in .github folder by default.
Action: backbase-common/gc-ai-workflows/check-action-pinning@main

Usage

- uses: backbase-common/gc-ai-workflows/check-action-pinning@main
  with:
    path: ".github"
    fail-on-error: "false"
    skip-organisation-name: "backbase-common"

Input Parameters

ParameterDescriptionDefault
pathRelative path to GitHub actions location.github
fail-on-errorFail if violation is foundfalse
skip-organisation-nameOrganization to skip during validationbackbase-common

Output Parameters

  • valid: Validation result ("true" or "false")
  • violations: List of violations in format: file path:external action, comma-separated

Resolve Metadata

Resolves project version and metadata from pyproject.toml using uv version. Action: backbase-common/gc-ai-workflows/resolve-metadata@main

Usage

- uses: backbase-common/gc-ai-workflows/resolve-metadata@main
  id: metadata

Output Parameters

  • version: Raw version from uv version
  • releaseVersion: Release version (without dev/alpha/beta/rc)
  • nextVersion: Next version (incremented patch with .dev0)
  • devVersion: Development version with branch and commit info
  • buildVersion: Build version (release or dev)
  • isStable: Whether this is a stable version
  • major, minor, patch: Version components
  • name: Project name from git repository
  • projectKey: Sonar project key
  • organization: GitHub organization

Setup Promptfoo

Sets up Node.js and installs promptfoo globally for LLM prompt evaluation. Action: backbase-common/gc-ai-workflows/setup-promptfoo@main

Usage

- uses: backbase-common/gc-ai-workflows/setup-promptfoo@main
  with:
    nodeVersion: "20"

Input Parameters

ParameterDescriptionDefault
nodeVersionNode.js version to use20

Next Steps