mirror of
https://github.com/BreizhHardware/portfolio.git
synced 2026-03-18 21:40:29 +01:00
Merge pull request #333 from BreizhHardware/fix/security-audit
fix(audit): prevent duplicate security audit issue creation
This commit is contained in:
16
.github/workflows/audit.yml
vendored
16
.github/workflows/audit.yml
vendored
@@ -38,7 +38,21 @@ jobs:
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.create({
|
||||
const issues = await github.rest.issues.listForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
labels: 'security,audit'
|
||||
});
|
||||
|
||||
const openIssues = issues.data.filter(issue => !issue.pull_request);
|
||||
|
||||
if (openIssues.length > 0) {
|
||||
console.log('An open security audit issue already exists. Skipping creation.');
|
||||
return;
|
||||
}
|
||||
|
||||
await github.rest.issues.create({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
title: 'Security Audit Failed',
|
||||
|
||||
Reference in New Issue
Block a user