Forge固有のリポジトリフォルダ
Andrew Nesbittの記事は、GitHubやGitLabなど主要なコードフォージがGitリポジトリの特殊フォルダ(.github, .gitlabなど)を使用してCI/CDやレビュー設定を標準化している現状と、各プラットフォーム間の互換性の欠如について解説している。
キーポイント
GitHubの標準化と拡張機能
.github/workflows/によるActions CI、CODEOWNERSによるレビュー担当者の指定、およびISSUE_TEMPLATEなどのテンプレート管理が標準化されている。
GitLabとGitea/Forgejoの独自仕様
GitLabはルート直下の.gitlab-ci.ymlを優先し、GiteaやForgejoは.gitea/.forgejoフォルダを優先的に読み取りつつ.githubとの併用も可能とする階層構造を採用している。
Bitbucketの高度なレビュー戦略
BitbucketはCODEOWNERS構文にrandom(1)やleast_busy(2)といったレビュー担当者選定アルゴリズムを組み込んでおり、他プラットフォームにはない独自機能を持つ。
ポータビリティの課題
フォルダ名やファイル形式がプラットフォームごとに異なり、設定の移植性が低いことが指摘されており、マルチフォージ環境での運用には注意が必要である。
.bitbucket/teams.yamlによるアドホックレビューアグループの定義
.bitbucket/teams.yamlファイルを使用することで、正式なBitbucketチームを作成せずにアドホックなレビューアグループを定義し、CODEOWNERSで@teams/プレフィックスを参照できる。
マルチプラットフォーム対応における設定ファイルの優先順位と制限
.github/の設定はGiteaやForgejoで共有されるが、BitbucketとGitLabは独自のフォルダのみ参照するため、完全なマルチプラットフォームサポートには設定の重複が必要になる。
GitHubとGitea/Forgejoにおけるフォールバックの「全か無か」ルール
GitHubのorgレベルテンプレートやGitea/Forgejoのワークフローは、リポジトリ内に同名のファイルが存在すると親レベルの設定が完全に無視されるため、部分的な継承や併存ができない。
影響分析・編集コメントを表示
影響分析
この記事は、DevOpsエンジニアや開発者がマルチフォージ環境(GitHub, GitLab, Giteaなど)で作業する際の「設定の断絶」という実務上の課題を明確に示している。技術的な革新性よりも、既存のインフラストラクチャの非互換性を可視化しており、ツールチェーンの標準化や設定管理の自動化(Infrastructure as Code)の重要性を再認識させる内容である。
編集コメント
AI開発現場においても、モデルやコードのホスティング先が複数存在する場合、この「フォージ固有の設定フォルダ」の違いはデプロイメントの複雑さを増す要因となる。マルチクラウド・マルチフォージ戦略を取る組織は、設定管理の抽象化レイヤーを構築する必要がある。
要約:Gitホスティングサービス固有のリポジトリフォルダ
Git自体はCI(継続的インテグレーション)やコードレビュー、Issueテンプレートといった機能を知らない。しかし、Gitリポジトリをホストする各「フォージ」(サービスプラットフォーム)は、同じ手法でこれらの機能を追加している。それは、リポジトリのルートに配置されたドットフォルダを、プッシュ時に読み取るという方法である。フォルダ名はサービスごとに異なり、内容も一部は重複するが別の部分もあり、設定の互換性は期待よりも低い。
GitHub
主要な設定は .github/ フォルダ内に配置される。
.github/workflows/: GitHub ActionsによるCI/CDの設定YAMLファイルを格納。ISSUE_TEMPLATE/,PULL_REQUEST_TEMPLATE/: Issueやプルリクエストのテンプレート。CODEOWNERS: パスに対して必須のレビュアー(GitHubユーザーまたはチーム)を指定。gitignore風のグロブパターンを使用。- その他、
dependabot.yml(依存関係の自動更新)やFUNDING.yml(スポンサーボタン設定)もここに。SECURITY.mdなどのファイルはルート直下または.github/内から読み取られる。
GitLab
主要な設定フォルダは .gitlab/。
merge_request_templates/,issue_templates/: マージリクエストとIssueのテンプレート。- メインのCI設定はフォルダ内ではなく、リポジトリルートの
.gitlab-ci.ymlファイルで行う。再利用可能なCIテンプレートを.gitlab/ci/に置く慣例があるが、これは特別扱いされる名前ではない。 CODEOWNERSはGitHubと同様の機能を持つが、GitLabの承認ワークフローと連携した独自の承認ルールオプションがある。
Gitea / Forgejo
GiteaとそのフォークであるForgejoは、.gitea/ または .forgejo/ フォルダを使用する。
workflows/: Gitea/Forgejo Actionsの設定ファイルを格納。- テンプレートのフォルダ名はGitHubと同様。
- 設定ファイルの読み取り順序に特徴がある。Forgejoは
.forgejo/→.gitea/→.github/の順、Giteaは.gitea/→.github/の順で探す。これにより、共通設定を.github/に、プラットフォーム固有の上書き設定を各サービスのフォルダに分けて保持できる。 CODEOWNERSでは、グロブパターンではなくGoの正規表現(例:.*\.js$)を使用する。
Bitbucket
設定は .bitbucket/ フォルダに集約される。
CODEOWNERS: 必須レビュアーを指定するが、構文にレビュアー選択戦略が組み込まれている点が他サービスと大きく異なる。random(1)(チームからランダムに1名)、least_busy(2)(未処理PRが最も少ない2名)、all(全員)といった指定が
原文を表示
Forge-Specific Repository Folders | Andrew Nesbitt Git doesn’t know about CI, code review, or issue templates, but every forge that hosts git repositories has added these features through the same trick: a dot-folder in your repo root that the forge reads on push. The folder names differ, the contents overlap in some places and diverge in others, and the portability story between them is worse than you’d expect. A companion to my earlier post on git’s magic files.
workflows/ — GitHub Actions CI/CD configuration (.github/workflows/*.yml)
ISSUE_TEMPLATE/ and PULL_REQUEST_TEMPLATE/ — issue and PR templates
dependabot.yml — automated dependency updates
CODEOWNERS — required reviewers for paths
FUNDING.yml — sponsor button configuration
GitHub also reads some files from the repo root or from .github/: SECURITY.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, LICENSE.
The .github/workflows/ directory contains YAML files defining Actions workflows. Each file is a separate workflow that runs on events like push, pull request, or schedule.
CODEOWNERS uses gitignore-style glob patterns to map paths to GitHub users or teams who must review changes:
.github/CODEOWNERS *.js @frontend-team /docs/ @docs-team * @admins .gitlab/
merge_request_templates/ — MR templates
issue_templates/ — issue templates
changelog_config.yml — built-in changelog generation config
GitLab’s main CI config is .gitlab-ci.yml at the repo root, not in the folder. Projects often keep reusable CI templates in .gitlab/ci/ and pull them in with include:local, though the directory name is convention rather than something GitLab treats specially.
GitLab’s CODEOWNERS works similarly to GitHub’s but with different approval rule options and integration with GitLab’s approval workflows.
Gitea and Forgejo (a fork of Gitea) support:
workflows/ — Gitea/Forgejo Actions (.gitea/workflows/*.yml or .forgejo/workflows/*.yml)
ISSUE_TEMPLATE/ and PULL_REQUEST_TEMPLATE/ — templates
Forgejo checks .forgejo/ then .gitea/ then .github/ in that order, while Gitea checks .gitea/ then .github/, so you can keep shared config in .github/ and add platform-specific overrides in the forge’s own folder.
Gitea’s CODEOWNERS uses Go regexp instead of gitignore-style globs. Patterns look like .*\.js$ instead of *.js.
Bitbucket keeps two files in .bitbucket/:
CODEOWNERS — required reviewers
teams.yaml — ad-hoc reviewer groups
CI config lives at bitbucket-pipelines.yml in the repo root, similar to GitLab’s approach.
Bitbucket’s CODEOWNERS has reviewer selection strategies baked into the syntax:
.bitbucket/CODEOWNERS *.js random(1) @frontend-team /api/ least_busy(2) @backend-team /critical/ all @security-team random(1) picks one random reviewer from the team, least_busy(2) picks the two reviewers with the fewest open PRs, and all requires every team member to review. No other forge has reviewer selection strategies in the CODEOWNERS syntax.
The .bitbucket/teams.yaml file lets you define ad-hoc reviewer groups without creating formal Bitbucket teams:
.bitbucket/teams.yaml security: - alice - bob frontend: - carol - dave These can then be referenced in CODEOWNERS with the @teams/ prefix, like @teams/security or @teams/frontend.
If you host the same repository on multiple platforms, shared config in .github/ will be picked up by Gitea and Forgejo, with platform-specific overrides in .gitea/ or .forgejo/ taking priority. Bitbucket and GitLab only check their own folders, so multi-platform support across all forges still requires some duplication.
GitHub’s org-level .github repository lets you set default issue templates, PR templates, and community health files for every repo in the org, but the fallback is all-or-nothing: if a repo has any file in its own .github/ISSUE_TEMPLATE/ folder, none of the org-level templates are inherited and there’s no way to merge them. The org .github repo must also be public, so your default templates are visible to everyone.
GitHub looks for CODEOWNERS in three places: .github/CODEOWNERS, then CODEOWNERS at the root, then docs/CODEOWNERS. First one found wins and the others are silently ignored. The syntax looks like .gitignore but doesn’t support ! negation, [] character ranges, or \# escaping. A syntax error used to cause the entire file to be silently ignored, meaning no owners were assigned to anything. GitHub has since added error highlighting in the web UI but there’s still no push-time validation.
GitLab supports optional CODEOWNERS sections with a ^ prefix, but “optional” only applies to merge requests. If someone pushes directly to a protected branch, the docs say approval from those sections is “still required,” though how that actually works for a command-line push is unclear even to GitLab users.
The Gitea/Forgejo workflow fallback is all-or-nothing too: if .gitea/workflows/ contains any workflow files, .github/workflows/ is completely ignored, so you can’t run platform-specific workflows side by side.
Gitea’s CODEOW
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み