Add actions.WORKFLOW_DIRS setting#36619
Conversation
|
It really seems that it should be a repo-level config, but not a global config. |
|
I need it at global level. My instance has tons of copies/mirrors etc. from GitHub which trigger bogus actions runs. Per-repo setting can be added later to override the global setting, but I personally have no need for it. |
There was a problem hiding this comment.
Pull request overview
This PR adds a new FORGE_DIRS repository setting that controls which forge directories are searched for workflow files, allowing users to customize which directories (e.g., .gitea, .github) are used for Actions workflows.
Changes:
- Adds
FORGE_DIRSconfiguration option with default value[".gitea", ".github"] - Updates workflow detection logic to use configured forge directories instead of hardcoded paths
- Adds comprehensive test coverage for the new setting and workflow detection behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| modules/setting/repository.go | Adds ForgeDirs field and validation logic to ensure at least one directory is configured |
| modules/setting/repository_test.go | Tests configuration parsing and whitespace handling for FORGE_DIRS |
| modules/actions/workflows.go | Updates IsWorkflow and ListWorkflows to use configured directories |
| modules/actions/workflows_test.go | Tests workflow detection with various forge directory configurations |
| custom/conf/app.example.ini | Documents the new configuration option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
repository.FORGE_DIRS repository settingrepository.FORGE_DIRS setting
|
Still, I don't think the design is right. Now you have an option But there are also other |
|
Originally my suggestion was actually |
repository.FORGE_DIRS settingactions.WORKFLOW_DIRS setting
This new setting controls which forge directories and in which order workflow files are searched for. The default value matches the current behaviour. This allows users to exclude `.github/workflows` from being picked up by Actions in mirrored repositories by setting `FORGE_DIRS = .gitea`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: silverwind <me@silverwind.io>
Move the workflow directory configuration from `[repository] FORGE_DIRS` to `[actions] WORKFLOW_DIRS` and change the value format from forge directory prefixes (`.gitea`) to full workflow paths (`.gitea/workflows`). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: silverwind <me@silverwind.io>
…wDirs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66c5ae7 to
f4a9f38
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Ready again. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rove tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: silverwind <me@silverwind.io>
Fixes: #36612
This new setting controls which workflow directories are searched. The default value matches the previous hardcoded behaviour.
This allows users for example to exclude
.github/workflowsfrom being picked up by Actions in mirrored repositories by settingWORKFLOW_DIRS = .gitea/workflows.