Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,17 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
- `secret_type`: A comma-separated list of secret types to return. All default secret patterns are returned. To return generic patterns, pass the token name(s) in the parameter. (string, optional)
- `state`: Filter by state (string, optional)

- **update_secret_scanning_alert** - Update secret scanning alert
- **OAuth Challenge Scopes**: `security_events`
- `alertNumber`: Secret scanning alert number. (integer, required)
- `assignee`: Username with repository write access; null unassigns. (string | null, optional)
- `owner`: Repository owner. (string, required)
- `repo`: Repository name. (string, required)
- `resolution`: Reason for resolving. Non-null when state is resolved. (string | null, optional)
- `resolution_comment`: Optional comment when closing or reopening; cannot later be updated or deleted. (string | null, optional)
- `state`: Reopen or resolve the alert. (string, optional)
- `validity`: Manual validity override for custom-pattern alerts only; null clears the override. GitHub-supported patterns retain validator-managed validity. (string | null, optional)

</details>

<details>
Expand Down
19 changes: 19 additions & 0 deletions cmd/github-mcp-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ func TestCodeScanningUpdateListScopes(t *testing.T) {
}
}

func TestSecretScanningUpdateListScopes(t *testing.T) {
for _, readOnly := range []bool{false, true} {
inv, err := github.NewInventory(translations.NullTranslationHelper).
WithToolsets([]string{"secret_protection"}).WithReadOnly(readOnly).Build()
require.NoError(t, err)
output := collectToolScopes(inv, readOnly)
if readOnly {
assert.NotContains(t, output.ScopesByTool, "update_secret_scanning_alert")
continue
}
assert.Equal(t, []string{"security_events"}, output.ScopesByTool["update_secret_scanning_alert"])
assert.Contains(t, output.ToolsByScope["security_events"], "update_secret_scanning_alert")
assert.Contains(t, output.Tools, ToolScopeInfo{
Name: "update_secret_scanning_alert", Toolset: "secret_protection",
ReadOnly: false, ChallengeScopes: []string{"security_events"},
})
}
}

func TestSchemaTypeString(t *testing.T) {
tests := []struct {
name string
Expand Down
134 changes: 134 additions & 0 deletions pkg/github/__toolsnaps__/update_secret_scanning_alert.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"annotations": {
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true,
"readOnlyHint": false,
"title": "Update secret scanning alert"
},
"description": "Update a secret scanning alert's state, assignee, or validity override. Provide at least one of state, assignee, or validity. Resolving requires a non-null resolution. Omitted fields are unchanged; null unassigns the assignee or clears the validity override. Resolution comments accompany closing or reopening and cannot later be edited or deleted. Resolution revoked does not revoke credentials; validity is a manual override for custom-pattern alerts only, not a validation request. GitHub-supported patterns retain validator-managed validity and cannot be overridden through this endpoint. Requires repository secret scanning write access. Delegated dismissal may require Secret scanning alert dismissal requests write permission and an authorized reviewer; API policy failures are returned without bypass.",
"inputSchema": {
"additionalProperties": false,
"properties": {
"alertNumber": {
"description": "Secret scanning alert number.",
"minimum": 1,
"type": "integer"
},
"assignee": {
"description": "Username with repository write access; null unassigns.",
"type": [
"string",
"null"
]
},
"owner": {
"description": "Repository owner.",
"minLength": 1,
"type": "string"
},
"repo": {
"description": "Repository name.",
"minLength": 1,
"type": "string"
},
"resolution": {
"description": "Reason for resolving. Non-null when state is resolved.",
"enum": [
"false_positive",
"wont_fix",
"revoked",
"used_in_tests",
null
],
"type": [
"string",
"null"
]
},
"resolution_comment": {
"description": "Optional comment when closing or reopening; cannot later be updated or deleted.",
"type": [
"string",
"null"
]
},
"state": {
"description": "Reopen or resolve the alert.",
"enum": [
"open",
"resolved"
],
"type": "string"
},
"validity": {
"description": "Manual validity override for custom-pattern alerts only; null clears the override. GitHub-supported patterns retain validator-managed validity.",
"enum": [
"active",
"inactive",
null
],
"type": [
"string",
"null"
]
}
},
"required": [
"owner",
"repo",
"alertNumber"
],
"type": "object"
},
"name": "update_secret_scanning_alert",
"outputSchema": {
"additionalProperties": false,
"properties": {
"assigned_to": {
"additionalProperties": false,
"properties": {
"login": {
"type": "string"
}
},
"required": [
"login"
],
"type": [
"null",
"object"
]
},
"number": {
"description": "Exact alert number as a decimal string to preserve integer precision.",
"type": "string"
},
"resolution": {
"type": [
"null",
"string"
]
},
"state": {
"type": "string"
},
"validity": {
"type": [
"null",
"string"
]
}
},
"required": [
"number",
"state",
"resolution",
"assigned_to"
],
"type": [
"null",
"object"
]
}
}
1 change: 1 addition & 0 deletions pkg/github/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ func AllTools(t translations.TranslationHelperFunc, opts ...ToolOption) []invent
// Secret protection tools
GetSecretScanningAlert(t),
ListSecretScanningAlerts(t),
UpdateSecretScanningAlert(t),

// Dependabot tools
GetDependabotAlert(t),
Expand Down
2 changes: 2 additions & 0 deletions pkg/github/typed_security_outputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func securityOutputSchema(t *testing.T, name string) *jsonschema.Schema {
schema, err = jsonschema.For[[]*CodeScanningAlertOutput](nil)
case "get_secret_scanning_alert":
schema, err = jsonschema.For[*SecretScanningAlertOutput](nil)
case "update_secret_scanning_alert":
schema, err = jsonschema.For[*SecretScanningAlertUpdateOutput](nil)
case "list_secret_scanning_alerts":
schema, err = jsonschema.For[[]*SecretScanningAlertOutput](nil)
case "get_dependabot_alert":
Expand Down
Loading
Loading