-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (41 loc) · 1.44 KB
/
pr_copied_files.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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"