Compare commits
2 Commits
12787d8daf
...
928b88887d
| Author | SHA1 | Date | |
|---|---|---|---|
| 928b88887d | |||
| ed728e7028 |
@@ -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 }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user