Compare commits
24 Commits
edcb1adef0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 559ccca3f8 | |||
| bb4c82c8c6 | |||
| df1aa85151 | |||
| e3c125f99d | |||
| 284d715aa3 | |||
| dc9c2f6c4d | |||
| a08c3fc1fa | |||
| cad0a686c0 | |||
| fcb18d7fe3 | |||
| 8036b76f05 | |||
| ee20210c7b | |||
| b7b304b4fd | |||
| 74a631643b | |||
| 7e134c7a1c | |||
| 3b5b3414fc | |||
| b35dd1f5d4 | |||
| 928b88887d | |||
| ed728e7028 | |||
| 12787d8daf | |||
| da192e0228 | |||
| c6c2069195 | |||
| c685c9b519 | |||
| c9055bbd25 | |||
| e8c01c8747 |
@@ -81,19 +81,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
id: sort_files
|
id: sort_files
|
||||||
|
|
||||||
- name: Commit moved files
|
- name: Commit and push 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
|
|
||||||
if: steps.sort_files.outputs.files_moved == 'true'
|
if: steps.sort_files.outputs.files_moved == 'true'
|
||||||
run: |
|
run: |
|
||||||
# Get the repository URL dynamically
|
# Get the repository URL dynamically
|
||||||
@@ -116,23 +104,32 @@ jobs:
|
|||||||
echo "Domain: $DOMAIN"
|
echo "Domain: $DOMAIN"
|
||||||
echo "Repository Path: $REPO_PATH"
|
echo "Repository Path: $REPO_PATH"
|
||||||
echo "Worker: ${{ vars.WORKER_USERNAME }}"
|
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)"
|
echo "Pushing to: https://${DOMAIN}/${REPO_PATH} (with authentication)"
|
||||||
git push $PUSH_URL HEAD:${{ github.ref_name }}
|
git push $PUSH_URL HEAD:${{ github.ref_name }}
|
||||||
|
|
||||||
- name: Create summary
|
- name: Log results
|
||||||
run: |
|
run: |
|
||||||
echo "## Auto-Sort Results" >> $GITHUB_STEP_SUMMARY
|
# Check if files were moved by looking at the output from sort_files step
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
FILES_MOVED_OUTPUT="${{ steps.sort_files.outputs.files_moved }}"
|
||||||
if [ "${{ steps.sort_files.outputs.files_moved }}" = "true" ]; then
|
echo "Auto-Sort Results:"
|
||||||
echo "✅ Files were automatically moved to correct directories" >> $GITHUB_STEP_SUMMARY
|
echo "Debug: files_moved output = '$FILES_MOVED_OUTPUT'"
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "### Moved Files:" >> $GITHUB_STEP_SUMMARY
|
if [ "$FILES_MOVED_OUTPUT" = "true" ]; then
|
||||||
echo "- Datasheet files (DS_*) → docs/datasheets/" >> $GITHUB_STEP_SUMMARY
|
echo "✅ Files were automatically moved to correct directories"
|
||||||
echo "- Image files (IMG_*) → docs/images/" >> $GITHUB_STEP_SUMMARY
|
echo "- Datasheet files (DS_*) → docs/datasheets/"
|
||||||
|
echo "- Image files (IMG_*) → docs/images/"
|
||||||
else
|
else
|
||||||
echo "ℹ️ No files needed to be moved - all files are properly organized" >> $GITHUB_STEP_SUMMARY
|
echo "ℹ️ No files needed to be moved - all files are properly organized"
|
||||||
fi
|
fi
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "### Supported Prefixes:" >> $GITHUB_STEP_SUMMARY
|
echo "Supported Prefixes:"
|
||||||
echo "- **DS_**: Datasheets (PDF, DOC, DOCX, TXT)" >> $GITHUB_STEP_SUMMARY
|
echo "- DS_: Datasheets (PDF, DOC, DOCX, TXT)"
|
||||||
echo "- **IMG_**: Images (PNG, JPG, SVG, GIF, PDF, WEBP)" >> $GITHUB_STEP_SUMMARY
|
echo "- IMG_: Images (PNG, JPG, SVG, GIF, PDF, WEBP)"
|
||||||
|
|||||||
@@ -65,6 +65,12 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Infinite Loop Prevention
|
||||||
|
The workflow uses the `[skip actions]` flag in commit messages to prevent infinite loops:
|
||||||
|
- When files are moved, the commit message includes `[skip actions]`
|
||||||
|
- This prevents the workflow from triggering again on its own commits
|
||||||
|
- Standard Gitea Actions approach for preventing recursive execution
|
||||||
|
|
||||||
### Authentication Method
|
### Authentication Method
|
||||||
The workflow uses token-based authentication and dynamically detects the repository URL:
|
The workflow uses token-based authentication and dynamically detects the repository URL:
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
BIN
docs/datasheets/DS_AD8411AWBRZ-RL.pdf
Normal file
BIN
docs/datasheets/DS_AD8411AWBRZ-RL.pdf
Normal file
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user