From 41ee37910e8b0d022bbeaf80d9e720c21415dd9c Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Wed, 23 Aug 2023 16:35:59 +0200 Subject: [PATCH] ci: add workflow to check db freshness --- .../workflows/check_outdated_build_db.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/check_outdated_build_db.yaml 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