From abe857d66bbff9c9614cc943c0c317c9c503e883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Fri, 1 Nov 2024 23:35:22 -0300 Subject: [PATCH 1/4] Fixed sort data files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/sort-data.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sort-data.yml b/.github/workflows/sort-data.yml index 8823f505..1f5a1c61 100644 --- a/.github/workflows/sort-data.yml +++ b/.github/workflows/sort-data.yml @@ -31,11 +31,13 @@ jobs: with: files: assets/data/**.{json} - - name: Sort data files + - name: Setup Python if: steps.changed-data.outputs.any_changed == 'true' uses: actions/setup-python@v5 with: python-version: '3.12' + + - name: Sort data files env: ALL_CHANGED_FILES: ${{ steps.changed-data.outputs.all_changed_files }} run: | From f1394be916156b7bdd5bc2e1a5bfb5a746e82dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Fri, 1 Nov 2024 23:51:46 -0300 Subject: [PATCH 2/4] Printing which files are being formatted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/sort-data.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sort-data.yml b/.github/workflows/sort-data.yml index 1f5a1c61..31773919 100644 --- a/.github/workflows/sort-data.yml +++ b/.github/workflows/sort-data.yml @@ -42,6 +42,7 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-data.outputs.all_changed_files }} run: | for file in $ALL_CHANGED_FILES; do + echo "Formatting $file" python3 format_data.py -f $file done From 4e0e3c01797984ef0c8c94f9f8c48baa234fb735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Sat, 2 Nov 2024 00:01:46 -0300 Subject: [PATCH 3/4] Changed file pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/sort-data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sort-data.yml b/.github/workflows/sort-data.yml index 31773919..f3525711 100644 --- a/.github/workflows/sort-data.yml +++ b/.github/workflows/sort-data.yml @@ -29,7 +29,7 @@ jobs: id: changed-data uses: tj-actions/changed-files@v45 with: - files: assets/data/**.{json} + files: assets/data/**.json - name: Setup Python if: steps.changed-data.outputs.any_changed == 'true' From 1414e4dd4a652ea49617908b55e5c2259bdc7cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Ara=C3=BAjo?= Date: Sat, 2 Nov 2024 00:15:20 -0300 Subject: [PATCH 4/4] Added more if conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araújo --- .github/workflows/sort-data.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sort-data.yml b/.github/workflows/sort-data.yml index f3525711..f2734d2c 100644 --- a/.github/workflows/sort-data.yml +++ b/.github/workflows/sort-data.yml @@ -38,6 +38,7 @@ jobs: python-version: '3.12' - name: Sort data files + if: steps.changed-data.outputs.any_changed == 'true' env: ALL_CHANGED_FILES: ${{ steps.changed-data.outputs.all_changed_files }} run: | @@ -48,5 +49,6 @@ jobs: # commit all changed files back to the repository - uses: stefanzweifel/git-auto-commit-action@v5 + if: steps.changed-data.outputs.any_changed == 'true' with: commit_message: Sort data files