func (a *Alert) ID() int64 {
	if a == nil {
		return 0
	}
	s := a.GetHTMLURL()
	if i := strings.LastIndex(s, "/"); i >= 0 {
		s = s[i+1:]
	}
	id, err := strconv.ParseInt(s, 10, 64)
	if err != nil {
		return 0
	}
	return id
}
ID returns the ID associated with an alert. It is the number at the end of the security alert's URL.
package github
import (
	"context"
	"fmt"
	"strconv"
	"strings"
)
type CodeScanningService service
type Alert struct {
	RuleID          *string    `json:"rule_id,omitempty"`
	RuleSeverity    *string    `json:"rule_severity,omitempty"`
	RuleDescription *string    `json:"rule_description,omitempty"`
	Tool            *string    `json:"tool,omitempty"`
	CreatedAt       *Timestamp `json:"created_at,omitempty"`
	Open            *bool      `json:"open,omitempty"`
	ClosedBy        *User      `json:"closed_by,omitempty"`
	ClosedAt        *Timestamp `json:"closed_at,omitempty"`
	URL             *string    `json:"url,omitempty"`
	HTMLURL         *string    `json:"html_url,omitempty"`
}