From 9970270404a2590ba4ce56f464b6a522b26185c0 Mon Sep 17 00:00:00 2001 From: Thomas Capelle Date: Fri, 26 Jul 2024 14:24:18 +0200 Subject: [PATCH] add cleanup workflow (#554) --- .github/workflows/cleanup.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/cleanup.yml diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 00000000..cd5d90a9 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,32 @@ +name: Clean Notebooks +on: + push: + paths: + - '**.ipynb' + workflow_dispatch: + +jobs: + fix: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Install Dependencies + run: | + python -m pip install -r requirements.txt + - name: Test clean up .ipynb files + shell: bash + run: | + nb_helpers.fix_nbs . + git status -s # display the status to see which nbs need cleaning up + if [[ `git status --porcelain -uno` ]]; then + git status -uno + echo -e "!!! Detected unstripped out notebooks\n!!!Remeber to run nb_helpers.fix_nbs" + false + fi \ No newline at end of file