Skip to content

Add configurable forge directories setting for Actions #36612

@silverwind

Description

@silverwind

Issue created by @silverwind via Claude Code

Feature Request

Currently, the workflow directory paths .gitea/workflows and .github/workflows are hardcoded in modules/actions/workflows.go (ListWorkflows and IsWorkflow functions). Gitea checks .gitea/workflows first, and if it exists, .github/workflows is completely ignored.

Proposal

Add a new app.ini setting under [actions] to make the forge directories configurable:

[actions]
FORGE_DIRS = .gitea, .github
  • The setting defines which forge directories are searched for workflows (and potentially other forge metadata) and in what order (first match wins, like current behavior).
  • Default value: .gitea, .github (preserving current behavior).
  • Workflow paths are derived by appending /workflows to each forge directory.
  • Admins who don't want .github/workflows to trigger Gitea Actions (e.g. for repos mirrored from GitHub) can set it to just .gitea.
  • This is more future-proof than a workflow-specific setting, as other forge metadata files under these directories could also benefit from the same configuration.

Use Case

Repositories mirrored from or also hosted on GitHub often contain .github/workflows that are designed for GitHub Actions and will fail or behave unexpectedly when picked up by Gitea Actions runners. Currently, the only workarounds are:

  1. Delete the .github directory from the repo
  2. Add an empty .gitea/workflows directory to shadow it
  3. Disable Actions entirely for the repo

A configurable setting would provide a clean server-level solution.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/gitea-actionsrelated to the actions of Giteatype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions