Skip to content

Unblock EXTERNAL/EXTERNAL_VPC Cloud KMS key creation. #144

Unblock EXTERNAL/EXTERNAL_VPC Cloud KMS key creation.

Unblock EXTERNAL/EXTERNAL_VPC Cloud KMS key creation. #144

name: mmv1-lint-product-yaml
permissions: read-all
on:
pull_request:
paths:
- 'mmv1/products/**'
jobs:
lint-yaml:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2
with:
path: repo
fetch-depth: 0
- name: Check for mmv1 product file changes
id: pull_request
run: |
cd repo
git config user.name "modular-magician"
git config user.email "[email protected]"
git fetch origin ${{ github.base_ref }} # Fetch the base branch
git merge --no-ff origin/${{ github.base_ref }} # Merge with the base branch
yamlfiles=$(git diff --name-only origin/${{ github.base_ref }} -- mmv1/products) # Compare with the base branch
if [ ! -z "$yamlfiles" ]; then
echo "yamlfiles=repo/${yamlfiles//$'\n'/ repo/}" >> $GITHUB_OUTPUT
fi
- name: Install yamllint
if: ${{ !failure() && steps.pull_request.outputs.yamlfiles != '' }}
run: pip install yamllint==1.32.0 pyyaml==6.0.1 pathspec==0.12.1 --no-deps
- name: Lint YAML files
if: ${{ !failure() && steps.pull_request.outputs.yamlfiles != '' }}
run: yamllint -c repo/.yamllint ${{steps.pull_request.outputs.yamlfiles}}