diff --git a/.gitea/workflows/auto-sort-files.yml b/.gitea/workflows/auto-sort-files.yml index 9d495bd..2938e3f 100644 --- a/.gitea/workflows/auto-sort-files.yml +++ b/.gitea/workflows/auto-sort-files.yml @@ -12,8 +12,6 @@ on: jobs: auto-sort: runs-on: ubuntu-latest - # Skip if the commit was made by the CI bot to prevent infinite loops - if: ${{ !contains(github.event.head_commit.message, 'Auto-sort:') }} steps: - name: Checkout repository @@ -83,19 +81,7 @@ jobs: fi id: sort_files - - name: Commit moved files - if: steps.sort_files.outputs.files_moved == 'true' - run: | - git config --local user.email "${{ vars.WORKER_EMAIL }}" - git config --local user.name "${{ vars.WORKER_USERNAME }}" - # git mv already stages the changes, so no need for git add - git commit -m "Auto-sort: Move DS_ and IMG_ prefixed files to correct directories - - - Moved datasheet files (DS_*) to docs/datasheets/ - - Moved image files (IMG_*) to docs/images/ - - Automated by Gitea Actions auto-sort workflow" - - - name: Push changes + - name: Commit and push moved files if: steps.sort_files.outputs.files_moved == 'true' run: | # Get the repository URL dynamically @@ -118,6 +104,14 @@ jobs: echo "Domain: $DOMAIN" echo "Repository Path: $REPO_PATH" echo "Worker: ${{ vars.WORKER_USERNAME }}" + + # Commit with inline git configuration and [skip actions] flag + git -c user.name="${{ vars.WORKER_USERNAME }}" -c user.email="${{ vars.WORKER_EMAIL }}" commit -m "Auto-sort: Move DS_ and IMG_ prefixed files to correct directories [skip actions] + + - Moved datasheet files (DS_*) to docs/datasheets/ + - Moved image files (IMG_*) to docs/images/ + - Automated by Gitea Actions auto-sort workflow" + echo "Pushing to: https://${DOMAIN}/${REPO_PATH} (with authentication)" git push $PUSH_URL HEAD:${{ github.ref_name }}