Skip to content

Add actions.WORKFLOW_DIRS setting#36619

Merged
silverwind merged 14 commits into
go-gitea:mainfrom
silverwind:forgedirs
Feb 19, 2026
Merged

Add actions.WORKFLOW_DIRS setting#36619
silverwind merged 14 commits into
go-gitea:mainfrom
silverwind:forgedirs

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Feb 13, 2026

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/workflows from being picked up by Actions in mirrored repositories by setting WORKFLOW_DIRS = .gitea/workflows.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 13, 2026
@silverwind silverwind added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 13, 2026
@github-actions github-actions Bot added modifies/go docs-update-needed The document needs to be updated synchronously labels Feb 13, 2026
@silverwind silverwind requested a review from Copilot February 13, 2026 19:37
@wxiaoguang
Copy link
Copy Markdown
Contributor

It really seems that it should be a repo-level config, but not a global config.

@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Feb 13, 2026

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DIRS configuration 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.

@silverwind silverwind changed the title Add repository.FORGE_DIRS repository setting Add repository.FORGE_DIRS setting Feb 13, 2026
Comment thread custom/conf/app.example.ini Outdated
Comment thread custom/conf/app.example.ini Outdated
Comment thread custom/conf/app.example.ini Outdated
@wxiaoguang
Copy link
Copy Markdown
Contributor

Still, I don't think the design is right.

Now you have an option [repository] FORGE_DIRS, it only affects Actions.

But there are also other .gitea directories in whole code base, it will only mislead and confuse end users: which directory should be used?

@silverwind
Copy link
Copy Markdown
Member Author

Originally my suggestion was actually actions.WORKFLOW_DIRS, the idea with FORGE_DIRS came from the idea that we may want to read other files besides workflows out of these dirs. But given that we already read ISSUE_TEMPLATE and other stuff, it'll be better to revert to actions.WORKFLOW_DIRS and have a explicit config that only applies to workflows.

Comment thread custom/conf/app.example.ini Outdated
@silverwind silverwind changed the title Add repository.FORGE_DIRS setting Add actions.WORKFLOW_DIRS setting Feb 14, 2026
silverwind and others added 9 commits February 14, 2026 19:38
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>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@silverwind silverwind requested a review from Copilot February 14, 2026 18:42
@silverwind
Copy link
Copy Markdown
Member Author

Ready again.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread modules/actions/workflows_test.go
Comment thread modules/actions/workflows.go Outdated
Comment thread modules/actions/workflows.go Outdated
Comment thread modules/setting/actions.go
Comment thread custom/conf/app.example.ini Outdated
Comment thread modules/setting/actions_test.go Outdated
@ChristopherHX ChristopherHX added the topic/gitea-actions related to the actions of Gitea label Feb 15, 2026
silverwind and others added 2 commits February 16, 2026 16:43
Comment thread custom/conf/app.example.ini Outdated
Signed-off-by: silverwind <me@silverwind.io>
@silverwind silverwind requested a review from Zettat123 February 18, 2026 06:32
@silverwind silverwind removed the request for review from Zettat123 February 18, 2026 06:33
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 18, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 18, 2026
@silverwind silverwind merged commit 147bdfc into go-gitea:main Feb 19, 2026
24 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Feb 19, 2026
@silverwind silverwind deleted the forgedirs branch February 19, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-needed The document needs to be updated synchronously lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/gitea-actions related to the actions of Gitea type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add configurable forge directories setting for Actions

7 participants