diff --git a/WORKFLOW.md b/WORKFLOW.md index b2db94dbe..8d82347d6 100644 --- a/WORKFLOW.md +++ b/WORKFLOW.md @@ -38,7 +38,7 @@ Prescriptive style/legibility rules. Cheap to check, necessary but not sufficien - **Reusable-workflow permissions.** Job-level `permissions:` are validated **before** `if:`, so even a skipped job needs valid permissions. Grant least privilege; a reusable callee's extra scope (e.g. `actions: write` for cleanup) is granted by the **caller**. - **Allowlist `success` and `skipped` explicitly** across optional dependencies (`!= 'failure'` lets `cancelled` through). - **Docker layer cache.** Cache to/from a registry tag (`type=registry`), never `type=gha`. -- **Line endings.** Workflow YAML follows `.editorconfig` (CRLF here); committed JSON state files follow the repo's JSON rule. Preserve endings on every edit. +- **Line endings.** Workflow YAML is LF (Actions and Dependabot rewrite it that way); other files follow `.editorconfig`, and committed JSON state files follow the repo's JSON rule. Preserve endings on every edit. ## 3. Architecture diff --git a/repo-config/README.md b/repo-config/README.md index ff07b8811..df3feab23 100644 --- a/repo-config/README.md +++ b/repo-config/README.md @@ -18,7 +18,7 @@ for name in develop main; do id=$(gh api repos/ptr727/ProjectTemplate/rulesets --jq ".[] | select(.name==\"$name\") | .id") gh api "repos/ptr727/ProjectTemplate/rulesets/$id" \ --jq '{name, target, enforcement, bypass_actors, conditions, rules}' \ - | jq -S '.' > "repo-config/$name.json" + | jq -S --indent 4 '.' > "repo-config/$name.json" done ``` diff --git a/repo-config/develop.json b/repo-config/develop.json index 6fe170290..efc4262b0 100644 --- a/repo-config/develop.json +++ b/repo-config/develop.json @@ -1,68 +1,68 @@ { - "bypass_actors": [ - { - "actor_id": 5, - "actor_type": "RepositoryRole", - "bypass_mode": "always" - } - ], - "conditions": { - "ref_name": { - "exclude": [], - "include": [ - "refs/heads/develop" - ] - } - }, - "enforcement": "active", - "name": "develop", - "rules": [ - { - "type": "deletion" + "bypass_actors": [ + { + "actor_id": 5, + "actor_type": "RepositoryRole", + "bypass_mode": "always" + } + ], + "conditions": { + "ref_name": { + "exclude": [], + "include": [ + "refs/heads/develop" + ] + } }, - { - "type": "non_fast_forward" - }, - { - "type": "required_linear_history" - }, - { - "type": "required_signatures" - }, - { - "parameters": { - "allowed_merge_methods": [ - "squash" - ], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": false, - "require_last_push_approval": false, - "required_approving_review_count": 0, - "required_review_thread_resolution": true, - "required_reviewers": [] - }, - "type": "pull_request" - }, - { - "parameters": { - "do_not_enforce_on_create": false, - "required_status_checks": [ - { - "context": "Check pull request workflow status job", - "integration_id": 15368 - } - ], - "strict_required_status_checks_policy": false - }, - "type": "required_status_checks" - }, - { - "parameters": { - "review_draft_pull_requests": true, - "review_on_push": true - }, - "type": "copilot_code_review" - } - ], - "target": "branch" + "enforcement": "active", + "name": "develop", + "rules": [ + { + "type": "deletion" + }, + { + "type": "non_fast_forward" + }, + { + "type": "required_linear_history" + }, + { + "type": "required_signatures" + }, + { + "parameters": { + "allowed_merge_methods": [ + "squash" + ], + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": false, + "require_last_push_approval": false, + "required_approving_review_count": 0, + "required_review_thread_resolution": true, + "required_reviewers": [] + }, + "type": "pull_request" + }, + { + "parameters": { + "do_not_enforce_on_create": false, + "required_status_checks": [ + { + "context": "Check pull request workflow status job", + "integration_id": 15368 + } + ], + "strict_required_status_checks_policy": false + }, + "type": "required_status_checks" + }, + { + "parameters": { + "review_draft_pull_requests": true, + "review_on_push": true + }, + "type": "copilot_code_review" + } + ], + "target": "branch" } diff --git a/repo-config/main.json b/repo-config/main.json index d8551f47e..5d8d7b2dd 100644 --- a/repo-config/main.json +++ b/repo-config/main.json @@ -1,65 +1,65 @@ { - "bypass_actors": [ - { - "actor_id": 5, - "actor_type": "RepositoryRole", - "bypass_mode": "always" - } - ], - "conditions": { - "ref_name": { - "exclude": [], - "include": [ - "refs/heads/main" - ] - } - }, - "enforcement": "active", - "name": "main", - "rules": [ - { - "type": "deletion" + "bypass_actors": [ + { + "actor_id": 5, + "actor_type": "RepositoryRole", + "bypass_mode": "always" + } + ], + "conditions": { + "ref_name": { + "exclude": [], + "include": [ + "refs/heads/main" + ] + } }, - { - "type": "non_fast_forward" - }, - { - "type": "required_signatures" - }, - { - "parameters": { - "allowed_merge_methods": [ - "merge" - ], - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": false, - "require_last_push_approval": false, - "required_approving_review_count": 0, - "required_review_thread_resolution": true, - "required_reviewers": [] - }, - "type": "pull_request" - }, - { - "parameters": { - "do_not_enforce_on_create": false, - "required_status_checks": [ - { - "context": "Check pull request workflow status job", - "integration_id": 15368 - } - ], - "strict_required_status_checks_policy": false - }, - "type": "required_status_checks" - }, - { - "parameters": { - "review_draft_pull_requests": true, - "review_on_push": true - }, - "type": "copilot_code_review" - } - ], - "target": "branch" + "enforcement": "active", + "name": "main", + "rules": [ + { + "type": "deletion" + }, + { + "type": "non_fast_forward" + }, + { + "type": "required_signatures" + }, + { + "parameters": { + "allowed_merge_methods": [ + "merge" + ], + "dismiss_stale_reviews_on_push": true, + "require_code_owner_review": false, + "require_last_push_approval": false, + "required_approving_review_count": 0, + "required_review_thread_resolution": true, + "required_reviewers": [] + }, + "type": "pull_request" + }, + { + "parameters": { + "do_not_enforce_on_create": false, + "required_status_checks": [ + { + "context": "Check pull request workflow status job", + "integration_id": 15368 + } + ], + "strict_required_status_checks_policy": false + }, + "type": "required_status_checks" + }, + { + "parameters": { + "review_draft_pull_requests": true, + "review_on_push": true + }, + "type": "copilot_code_review" + } + ], + "target": "branch" }