Skip to content

Commit 574f3f3

Browse files
Add link to GH alert page.
1 parent 495bf4b commit 574f3f3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/SecurityAlertIssue.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ class SecurityAlertIssue extends JiraSecurityIssue
3838
*/
3939
protected string $severity;
4040

41+
/**
42+
* @var string
43+
*/
44+
protected string $alertNumber;
45+
46+
/**
47+
* @var string
48+
*/
49+
protected string $advisorySummary;
50+
4151
/**
4252
* phpcs:disable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint
4353
*
@@ -52,6 +62,8 @@ public function __construct(array $data)
5262
$this->manifestPath = \pathinfo($data['vulnerableManifestPath'], \PATHINFO_DIRNAME);
5363
$this->id = $data['securityVulnerability']['advisory']['ghsaId'];
5464
$this->severity = $data['securityVulnerability']['severity'];
65+
$this->alertNumber = $data['number'];
66+
$this->advisorySummary = $data['securityVulnerability']['advisory']['summary'];
5567

5668
$references = [];
5769

@@ -67,9 +79,12 @@ public function __construct(array $data)
6779
$ecosystem = $data['securityVulnerability']['package']['ecosystem'] ?? '';
6880
$githubRepo = \getenv('GITHUB_REPOSITORY') ?: '';
6981
$safeVersion = $this->safeVersion ?? 'no fix';
82+
$alertNumber = $this->alertNumber;
83+
$advisorySummary = $this->advisorySummary;
7084

7185
$body = <<<EOT
7286
- Repository: [{$githubRepo}|https://github.com/{$githubRepo}]
87+
- Alert: [{$advisorySummary}|https://github.com/{$githubRepo}/security/dependabot/{$alertNumber}]
7388
- Package: {$this->package} ($ecosystem)
7489
- Vulnerable version: {$this->vulnerableVersionRange}
7590
- Secure version: {$safeVersion}

src/SyncCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ protected function fetchAlertData(): array
176176
vulnerableManifestFilename
177177
vulnerableManifestPath
178178
vulnerableRequirements
179+
number
179180
}
180181
}
181182
}

0 commit comments

Comments
 (0)