From 644f35c57f5396d586571896b0d9fa500fcdd1b4 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 24 Jan 2025 08:45:57 +0100 Subject: [PATCH] Add a separate action to list changed migrations --- .gitea/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitea/workflows/tests.yml b/.gitea/workflows/tests.yml index 8c05e89..dc34a3f 100644 --- a/.gitea/workflows/tests.yml +++ b/.gitea/workflows/tests.yml @@ -34,6 +34,20 @@ jobs: sleep 1 echo "Trying again" done + - name: Get all migrations added + id: changed-migration-files + uses: tj-actions/changed-files@v45 + with: + files: | + db/migrate/**.rb + - name: List all migrations added + if: steps.changed-migration-files.outputs.any_changed == 'true' + env: + ALL_CHANGED_FILES: ${{ steps.changed-migration-files.outputs.all_changed_files }} + run: | + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done - run: | git fetch origin ${{ github.event.pull_request.base.sha }} migrations_added=$(git diff ${{ github.event.pull_request.base.sha }} --name-only db/migrate/ | wc -l)