Skip to content

Files

Latest commit

 

History

History
36 lines (26 loc) · 816 Bytes

github-repositories-require-signed-commits.md

File metadata and controls

36 lines (26 loc) · 816 Bytes

Pattern: Disabled signed commits for GitHub

Issue: -

Description

You cannot guarantee the source of unsigned commits. Set require_signed_commits attribute to true to enable this setting.

Resolution: require signed commits for all protected branches.

Examples

Example of incorrect code:

resource "github_branch_protection" "bad_example" {
  repository_id = github_repository.example.node_id
  
  pattern          = "main"
  enforce_admins   = true
  allows_deletions = true
  require_signed_commits = false
}

Example of correct code:

resource "github_branch_protection" "good_example" {
  repository_id = github_repository.example.node_id
  pattern          = "main"
  enforce_admins   = true
  allows_deletions = true
  require_signed_commits = true
}