Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/codeowners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

# Reusable workflow to lint CODEOWNERS files in our *-infra repos

name: Lint CODEOWNERS

on:
workflow_call:
inputs:
exclude_dirs:
description: 'Directories to exclude from linting (space-separated, e.g. "projects misc modules")'
type: string
required: false
default: ""

jobs:
lint-codeowners:
runs-on: ubuntu-latest
container:
image: us-west1-docker.pkg.dev/moz-fx-platform-artifacts/platform-shared-images/sre-citools:1.0
options: --cpus 1
steps:
- name: Clone Repository
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Lint CODEOWNERS
run: |
exclude_args=""
for dir in ${INPUTS_EXCLUDE_DIRS}; do
exclude_args="$exclude_args --excludedirs $dir"
done
/usr/bin/lint-codeowners $GITHUB_WORKSPACE $exclude_args
env:
INPUTS_EXCLUDE_DIRS: ${{ inputs.exclude_dirs }}
26 changes: 26 additions & 0 deletions .github/workflows/docs/codeowners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# CODEOWNERS Linting Reusable Workflow

Validates CODEOWNERS files using the `lint-codeowners` tool found in [mozilla-it/sre-citools](https://github.com/mozilla-it/sre-citools).

## Inputs

| Name | Required | Type | Default | Description |
| -------------- | -------- | ------ | ------- | ------------------------------------------------------------------------ |
| `exclude_dirs` | false | string | `""` | Space-separated list of directories to exclude from linting (e.g. `"projects misc modules"`) |

## Usage

```yaml
name: Lint CODEOWNERS

on:
pull_request:
paths:
- 'CODEOWNERS'

jobs:
lint-codeowners:
uses: mozilla-it/deploy-actions/.github/workflows/codeowners.yml@main
with:
exclude_dirs: "projects misc modules" # optional: exclude specific directories
```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This repository contains GitHub Actions Composite Actions used for Deployment Au

## Workflows
* [build-and-push](./.github/workflows/docs/build-and-push.md)
* [codeowners](./.github/workflows/docs/codeowners.md)
* [diff-rendered-charts](./.github/workflows/docs/diff-rendered-charts.md)
* [psa-checker](./.github/workflows/docs/psa-checker.md)
* [validate-k8s-manifests](./.github/workflows/docs/validate-k8s-manifests.md)
Expand Down
Loading