Files
TheRock/.github/workflows/gitleaks.yml
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

94 lines
3.5 KiB
YAML

# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
#
name: Gitleaks
on:
workflow_call:
inputs:
scan_mode:
description: >-
'changed' (default) scans only commits introduced by the calling
event; requires a pull_request or push
event payload and hard-fails otherwise. 'all' scans the full
repository history and is required for schedule,
workflow_dispatch, release, and any other event type.
required: false
type: string
default: changed
report_formats:
description: >-
Comma-separated list of gitleaks report formats to produce. Allowed
values: 'sarif' (default), 'json', 'csv', 'junit'. SARIF outputs are
uploaded to GitHub code scanning via github/codeql-action/upload-sarif;
all other formats are uploaded as build artifacts via
actions/upload-artifact. Example: 'sarif,json'.
required: false
type: string
default: sarif
scan_path:
description: >-
Path (relative to the repository root) to scan. Defaults to '.' so
the entire superproject checkout is scanned; set to a subdirectory
(e.g. 'src/' or 'services/api/') to restrict the scan to that
subtree. The path MUST exist after checkout or the scan job fails.
Submodules are NOT scanned: the checkout step leaves them
uninitialized (its default), and each submodule is a separately
versioned ROCm or third-party repo with its own gitleaks coverage.
A PR that bumps a submodule SHA surfaces as a one-line change in
the superproject diff and is reviewable on its own.
required: false
type: string
default: "."
# Reusable workflows declare the *minimum* permissions every caller
# must grant.
permissions:
contents: read
jobs:
scan:
name: Gitleaks scan
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Bootstrap checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
- name: Compute checkout fetch-depth
id: depth
uses: ./.github/actions/compute_pr_fetch_depth
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: ${{ steps.depth.outputs.value }}
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Run gitleaks
id: scan
env:
GITLEAKS_SCAN_MODE: ${{ inputs.scan_mode }}
GITLEAKS_REPORT_FORMATS: ${{ inputs.report_formats }}
GITLEAKS_SOURCE_DIR: ${{ inputs.scan_path }}
run: python build_tools/scan_tools/github_actions/gitleaks.py
- name: Upload SARIF report to code scanning
if: always() && steps.scan.outputs.sarif_path != ''
uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
with:
sarif_file: ${{ steps.scan.outputs.sarif_path }}
category: gitleaks
- name: Upload non-SARIF reports
if: always() && steps.scan.outputs.non_sarif_paths != ''
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: gitleaks-report
path: ${{ steps.scan.outputs.non_sarif_paths }}
if-no-files-found: ignore