ci: scripts_test: rebase before running tests

Add a rebase on top of BASE_REF before the pytest run to make sure that
PRs that predates the test introduction runs on top of the current HEAD.
This prevents pytest from failing with error code 5 because no tests are
found.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
diff --git a/.github/workflows/scripts_tests.yml b/.github/workflows/scripts_tests.yml
index 3180db1..132d8f3 100644
--- a/.github/workflows/scripts_tests.yml
+++ b/.github/workflows/scripts_tests.yml
@@ -34,6 +34,17 @@
           ref: ${{ github.event.pull_request.head.sha }}
           fetch-depth: 0
 
+      - name: Rebase
+        continue-on-error: true
+        env:
+          BASE_REF: ${{ github.base_ref }}
+          PR_HEAD: ${{ github.event.pull_request.head.sha }}
+        run: |
+          git config --global user.email "actions@zephyrproject.org"
+          git config --global user.name "Github Actions"
+          git rebase origin/${BASE_REF}
+          git log --graph --oneline HEAD...${PR_HEAD}
+
       - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v4
         with: