Skip to content

simplify CI script to check diffs #132

simplify CI script to check diffs

simplify CI script to check diffs #132

name: CI Copied Files Check
on:
pull_request:
branches: [main]
jobs:
check_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: changed-files
uses: tj-actions/changed-files@v45
with:
files_yaml: |
staging:
- charts/staging/**
prod:
- charts/prod/**
- name: Check staging files
if: steps.changed-files.outputs.staging_any_changed == 'true'
run: |
echo "Changed files in staging:"
for file in ${{ steps.changed-files.outputs.staging_all_changed_files }}; do
echo "Checking $file..."
if ! ${{ github.workspace }}/.github/workflows/pr_check_copies.sh "$file" "staging" "dev"; then
echo "❌ $file differs from dev version"
exit 1
fi
done
echo "✅ All staging files match dev"
- name: Check prod files
if: steps.changed-files.outputs.prod_any_changed == 'true'
run: |
echo "Changed files in prod:"
for file in ${{ steps.changed-files.outputs.prod_all_changed_files }}; do
echo "Checking $file..."
if ! ${{ github.workspace }}/.github/workflows/pr_check_copies.sh "$file" "prod" "staging"; then
echo "❌ $file differs from staging version"
exit 1
fi
done
echo "✅ All prod files match staging"