diff --git a/.github/workflows/check_outdated_build_db.yaml b/.github/workflows/check_outdated_build_db.yaml new file mode 100644 index 0000000..221df2c --- /dev/null +++ b/.github/workflows/check_outdated_build_db.yaml @@ -0,0 +1,31 @@ +name: Check outdated build db + +on: + push: + +jobs: + compare_files: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build db + run: | + python3 create_app_list/main.py --output_file out.json + - name: Compare Files + run: | + # Compare two files using diff + diff -q out.json build_files/build.json + + # Store the exit code of the diff command + DIFF_EXIT_CODE=$? + + # If exit code is 0, files are the same; if not, they are different + if [ $DIFF_EXIT_CODE -ne 0 ]; then + echo "Files are different!" + exit 1 # Fail the workflow + else + echo "Files are the same!" + fi