From d73a663cf1c60808bb2d35676ca02641a22f8f79 Mon Sep 17 00:00:00 2001 From: 16bravo Date: Tue, 30 Jan 2024 00:40:18 +0100 Subject: [PATCH] stop workflow when error --- .github/workflows/init_database.yml | 1 + .github/workflows/update_static_html.yml | 9 +++++++++ scripts/db_initialisation.py | 2 -- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/init_database.yml b/.github/workflows/init_database.yml index f1c156d8..30898730 100644 --- a/.github/workflows/init_database.yml +++ b/.github/workflows/init_database.yml @@ -24,6 +24,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.x + - name: Check if database exists id: check-db run: | diff --git a/.github/workflows/update_static_html.yml b/.github/workflows/update_static_html.yml index 8506a9ed..e82289c8 100644 --- a/.github/workflows/update_static_html.yml +++ b/.github/workflows/update_static_html.yml @@ -30,6 +30,15 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: + - name: Check the previous workflow + run: | + if [ ${{ github.event.workflow_run.conclusion == 'success' }} ]; then + echo "Previous workflow OK" + else + echo "Previous workflow in error" + exit 1 + fi + - name: Checkout uses: actions/checkout@v4 - name: Setup Pages diff --git a/scripts/db_initialisation.py b/scripts/db_initialisation.py index 83d67025..88732733 100644 --- a/scripts/db_initialisation.py +++ b/scripts/db_initialisation.py @@ -1,8 +1,6 @@ import sqlite3 import pandas as pd -raise ValueError("Test Erreur") - database_path = 'data/BravoRanking.db' # Database connection