Compare commits

...

24 Commits

Author SHA1 Message Date
559ccca3f8 Merge branch 'main' of https://git.b4l.co.th/B4L/b4l-project-template
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 7s
2025-08-11 13:38:25 +07:00
bb4c82c8c6 Fix workflow for Gitea Actions compatibility
- Replace GITHUB_STEP_SUMMARY with simple echo logging for Gitea compatibility
- Remove GitHub-specific step summary features that don't work in Gitea Actions
- Convert Create summary step to Log results step with console output
- Maintain debug output and step communication for troubleshooting
- Ensure workflow is fully compatible with Gitea Actions environment
2025-08-11 13:38:02 +07:00
df1aa85151 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
2025-08-11 06:34:08 +00:00
e3c125f99d test files
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 6s
2025-08-11 13:33:56 +07:00
284d715aa3 Fix workflow summary step output debugging
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 6s
- Add debug output to show the value of files_moved from previous step
- Store step output in variable for better debugging and comparison
- Fix issue where Create summary step was always showing empty results
- Ensure proper step output communication between workflow steps
- Add debugging information to troubleshoot step output issues
2025-08-11 13:32:36 +07:00
dc9c2f6c4d del old
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 6s
2025-08-11 13:30:03 +07:00
a08c3fc1fa 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
2025-08-11 06:28:33 +00:00
cad0a686c0 two test files
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 7s
2025-08-11 13:28:22 +07:00
fcb18d7fe3 Delete docs/datasheets/DS_150080RS75000.pdf
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 5s
2025-08-11 13:26:48 +07:00
8036b76f05 Delete docs/datasheets/DS_30KPA_SERIES_N0126_REV.E.pdf
Some checks failed
Auto-Sort Files / auto-sort (push) Has been cancelled
2025-08-11 13:26:43 +07:00
ee20210c7b Delete DS_150080RS75000.pdf
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 6s
2025-08-11 13:26:31 +07:00
b7b304b4fd 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
2025-08-11 06:26:03 +00:00
74a631643b extra test\
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 6s
2025-08-11 13:25:51 +07:00
7e134c7a1c test file
Some checks failed
Auto-Sort Files / auto-sort (push) Failing after 4s
2025-08-11 13:24:21 +07:00
3b5b3414fc del old files
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 4s
2025-08-11 13:16:29 +07:00
b35dd1f5d4 Update documentation for [skip actions] approach
- Update GITEA-ACTIONS-SETUP.md to document [skip actions] flag usage
- Explain infinite loop prevention using standard Gitea Actions approach
- Remove references to conditional workflow execution based on commit message detection
- Document simplified git configuration using inline -c flags
- Provide clear explanation of how [skip actions] prevents recursive workflow execution
2025-08-11 13:12:38 +07:00
928b88887d Merge branch 'main' of https://git.b4l.co.th/B4L/b4l-project-template
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 6s
2025-08-11 13:10:43 +07:00
ed728e7028 Update workflow to use [skip actions] flag for infinite loop prevention
- Remove conditional check based on commit message detection
- Use [skip actions] flag in commit message to prevent workflow recursion
- Simplify git configuration using inline -c flags instead of git config --local
- Combine commit and push steps for cleaner workflow execution
- Follow Gitea Actions best practices for preventing infinite loops
- Maintain all functionality while using standard skip actions approach
2025-08-11 13:10:26 +07:00
12787d8daf Auto-sort: Move DS_ and IMG_ prefixed files to correct directories
All checks were successful
Auto-Sort Files / auto-sort (push) Has been skipped
- Moved datasheet files (DS_*) to docs/datasheets/
- Moved image files (IMG_*) to docs/images/
- Automated by Gitea Actions auto-sort workflow
2025-08-11 04:58:10 +00:00
da192e0228 test ds
Some checks failed
Auto-Sort Files / auto-sort (push) Failing after 5s
2025-08-11 11:57:57 +07:00
c6c2069195 Auto-sort: Move DS_ and IMG_ prefixed files to correct directories
All checks were successful
Auto-Sort Files / auto-sort (push) Has been skipped
- Moved datasheet files (DS_*) to docs/datasheets/
- Moved image files (IMG_*) to docs/images/
- Automated by Gitea Actions auto-sort workflow
2025-08-11 04:55:45 +00:00
c685c9b519 test files
Some checks failed
Auto-Sort Files / auto-sort (push) Has been cancelled
2025-08-11 11:55:33 +07:00
c9055bbd25 Merge branch 'main' of https://git.b4l.co.th/B4L/b4l-project-template
All checks were successful
Auto-Sort Files / auto-sort (push) Successful in 4s
2025-08-11 11:52:25 +07:00
e8c01c8747 Prevent infinite workflow loops by skipping CI bot commits
- Add condition to skip workflow when triggered by Auto-sort commits
- Use github.event.head_commit.message to detect CI bot commits
- Prevent infinite loop where workflow push triggers another workflow run
- Only run workflow for user commits, not automated CI commits
- Maintains functionality while preventing recursive execution
2025-08-11 11:52:04 +07:00
5 changed files with 72 additions and 69 deletions

View File

@@ -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)"

View File

@@ -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

Binary file not shown.

Binary file not shown.