Skip to content

Avoid pulling from all remote manifest branches #119

Avoid pulling from all remote manifest branches

Avoid pulling from all remote manifest branches #119

name: Validate changes to DataDog Service Catalog Files
# This workflow is a required check for PRs that change any of the DataDog Service Definition files. See .github/scripts/validate-datadog-yaml/README.md for more information
on:
pull_request:
paths:
- "datadog-service-catalog/**.yml"
jobs:
validate_files:
runs-on: ubuntu-latest
name: Validate changes to DataDog Service Catalog Files
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: setup python env
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install python requirements
working-directory: ./.github/scripts/validate-datadog-yaml
run: pip install -r requirements.txt
- name: Get Filenames
id: get_filenames
run: |
git fetch origin master --depth 1
echo changedFiles=$(git diff --diff-filter=d --name-only origin/master... -- "datadog-service-catalog/**.yml") >> $GITHUB_OUTPUT
- name: Validate Service Catalog Files
working-directory: ./.github/scripts/validate-datadog-yaml
run: |
files=("${{steps.get_filenames.outputs.changedFiles}}")
python validate_yaml.py -s datadog-schema2.2.json -F $files