From 87e4f3a70f3882444e66fe96ee492a87f0031deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20MARQUET?= <72651575+BreizhHardware@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:00:14 +0000 Subject: [PATCH] fix: prevent duplicate security audit issue creation --- .github/workflows/audit.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 56515bb..968e819 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -33,7 +33,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',