Set-GitHubDependabotAlert

SYNOPSIS

Update a Dependabot alert

SYNTAX

__AllParameterSets

Set-GitHubDependabotAlert [-Owner] <string> [-Repo] <string> [-AlertNumber] <long> [-State <string>]
 [-DismissedReason <string>] [-DismissedComment <string>] [-Assignees <string[]>]
 [-AgentAssignment <Object>] [-Body <Object>] [-Accept <string>] [-WhatIf] [-Confirm]

ALIASES

This cmdlet has the following aliases,

  • Get-GHSetDependabotAlert

DESCRIPTION

The Set-GitHubDependabotAlert cmdlet invokes the PATCH method of the /repos/{owner}/{repo}/dependabot/alerts/{alert_number} endpoint (Update a Dependabot alert)

The authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see “Granting access to security alerts (https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts).”

OAuth app tokens and personal access tokens (classic) need the ‘security_events’ scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the ‘public_repo’ scope instead.

Endpoint: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number} API version: 2026-03-10

EXAMPLES

EXAMPLE 1

Set-GitHubDependabotAlert -Owner 'octocat' -Repo 'Hello-World' -AlertNumber 1

Invokes PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}

EXAMPLE 2

Set-GitHubDependabotAlert -Owner 'octocat' -Repo 'Hello-World' -AlertNumber 1 -Body @{ state = 'dismissed' }

Sends the request body from a hashtable, parameters override the keys of -Body

PARAMETERS

-Accept

The Accept header (media type) of the request Default value: application/vnd.github+json

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AgentAssignment

Parameters for AI agent assignment. Only used when an agent bot login is included in ‘assignees’. Ignored when no agent is being assigned.

Body property [ agent_assignment ]

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AlertNumber

The number that identifies a Dependabot alert in its repository. You can find this at the end of the URL for a Dependabot alert within GitHub, or in ‘number’ fields in the response from the ‘GET /repos/{owner}/{repo}/dependabot/alerts’ operation.

Path parameter [ alert_number ]

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 2
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Assignees

Usernames to assign to this Dependabot Alert. Pass one or more user logins to replace the set of assignees on this alert. Send an empty array (‘[]’) to clear all assignees from the alert. To assign an AI agent, include the bot login (for example, ‘copilot-swe-agent[bot]’).

Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Body

The whole request body as a hashtable or object. Keys that are also available as parameters are overwritten by the parameter values

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DismissedComment

An optional comment associated with dismissing the alert.

Body property [ dismissed_comment ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-DismissedReason

Required when ‘state’ is ‘dismissed’. A reason for dismissing the alert.

Body property [ dismissed_reason ]

Allowed values: ‘fix_started’, ‘inaccurate’, ‘no_bandwidth’, ‘not_used’, ‘tolerable_risk’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Owner

The account owner of the repository. The name is not case sensitive.

Path parameter [ owner ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Repo

The name of the repository without the ‘.git’ extension. The name is not case sensitive.

Path parameter [ repo ]

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-State

The state of the Dependabot alert. A ‘dismissed_reason’ must be provided when setting the state to ‘dismissed’.

Allowed values: ‘dismissed’, ‘open’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

Runs the command in a mode that only reports what would happen without performing the actions.

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

Objects with properties named like the path parameters can be piped to this function

{{ Fill in the Description }}

System.String

{{ Fill in the Description }}

System.Int64

{{ Fill in the Description }}

OUTPUTS

The response of the GitHub API (objects

{{ Fill in the Description }}

NOTES

OperationId: dependabot/update-alert Category: dependabot / alerts