From 3f5936b09cbb67d46e2479d03cef748a23db5679 Mon Sep 17 00:00:00 2001 From: malmans2 Date: Mon, 21 Oct 2024 17:39:39 +0200 Subject: [PATCH] do not show untouched notebooks in preview --- .github/workflows/on-pull-request.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index 71a95d72..acfa7d4a 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -42,6 +42,25 @@ jobs: with: python-version: '3.x' cache: 'pip' + - uses: actions/checkout@v4 + - name: Get changed notebooks + id: changed-files + uses: tj-actions/changed-files@v45 + with: + files: | + **.ipynb + - name: Remove untouched notebooks + id: remove-untouched-notebooks + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: |- + for file in ${ALL_CHANGED_FILES}; do + mv "$file" "$file".keep + done + rm ./**/*.ipynb + for file in ${ALL_CHANGED_FILES}; do + mv "$file".keep "$file" + done - run: pip install -r requirements.txt - run: make build-book PRE_BUILD_DIR=${{ env.PRE_BUILD_DIR }} PRE_BUILD_FLAGS=${{ env.PRE_BUILD_FLAGS }} - uses: rossjrw/pr-preview-action@v1