feat: discover workflows in subdirectories of .mokogitea/workflows/ #693
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Gitea Actions currently only discovers workflow YAML files at the root level of
.gitea/workflows/(or.mokogitea/workflows/). Files in subdirectories like.mokogitea/workflows/custom/are NOT auto-discovered.Proposed Behavior
Recursively discover
*.yml/*.yamlfiles in subdirectories of the workflows directory. This allows organizations to use folder-based organization:Use Case
MokoCli's
workflow_synccommand pushes template workflows to all repos. Repos need a way to have custom workflows that aren't deleted during sync. Subfolder discovery would let repos put custom workflows incustom/and have them auto-discovered by Gitea Actions while being protected from sync cleanup.Current Workaround
Use a
custom-filename prefix at the root level. Works but is less clean than folder-based separation.Resolved in
afe46361c7.The recursive discovery infrastructure already existed —
ListWorkflowsusesListEntriesRecursiveFast()(git ls-tree -t -r), andIsWorkflow()uses a prefix check that naturally handles subdirectory paths. Added test cases confirming both single-level and deeply nested subdirectory workflows are discovered.Moved 6 custom (non-synced) workflows to
.mokogitea/workflows/custom/:deploy-mokogitea.yml,deploy-dev.yml,cascade-dev.yml,pr-rc-release.yml,test-mokogitea.yml,upstream-bug-sync.ymlThese are now cleanly separated from the 16 template-synced workflows (which have
FILE INFORMATIONheaders and stay at root level).