From bc71257e69bc64c1a4aaff6bac0a0593d486ab4f Mon Sep 17 00:00:00 2001 From: Ryan <16667079+mccaffers@users.noreply.github.com> Date: Mon, 4 May 2026 17:18:13 +0100 Subject: [PATCH 1/3] update sonar workflow --- .github/workflows/sonar.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index ed40ff2..81c930a 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -1,10 +1,11 @@ on: # Triggered on completion of the Build workflow so we can consume its - # coverage artifact. workflow_run fires regardless of whether the upstream - # was triggered by push or pull_request. + # coverage artifact. Limited to runs against main so we only scan the + # mainline; PR builds don't trigger Sonar. workflow_run: workflows: ["Build"] types: [completed] + branches: [main] name: SonarCloud Scan From 280ce6682366af968aef61beaa15829d5a34b6f4 Mon Sep 17 00:00:00 2001 From: Ryan <16667079+mccaffers@users.noreply.github.com> Date: Mon, 4 May 2026 17:19:38 +0100 Subject: [PATCH 2/3] tidy up close external pr's workflow --- .github/workflows/auto-close-external-prs.yml | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.github/workflows/auto-close-external-prs.yml b/.github/workflows/auto-close-external-prs.yml index 42a3926..e2188a0 100644 --- a/.github/workflows/auto-close-external-prs.yml +++ b/.github/workflows/auto-close-external-prs.yml @@ -28,31 +28,4 @@ jobs: repo: context.repo.repo, pull_number: pr, state: "closed" - }); - - sweep-existing: - if: github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - permissions: - pull-requests: write - issues: write - steps: - - uses: actions/github-script@v7 - with: - script: | - const owner = context.repo.owner; - const repo = context.repo.repo; - const prs = await github.paginate(github.rest.pulls.list, { - owner, repo, state: 'open', per_page: 100 - }); - for (const pr of prs) { - if (pr.user.login === owner) continue; - core.info(`Closing PR #${pr.number} by ${pr.user.login}`); - await github.rest.issues.createComment({ - owner, repo, issue_number: pr.number, - body: "Thanks for the interest! This repository isn't currently accepting external contributions as I am actively experimenting with different approaches and want to avoid merge conflicts. Therefore, this PR is being closed automatically by Github Bot." - }); - await github.rest.pulls.update({ - owner, repo, pull_number: pr.number, state: "closed" - }); - } + }); \ No newline at end of file From 2996209728ebc2b657ef8556055385e1fb858a4b Mon Sep 17 00:00:00 2001 From: Ryan <16667079+mccaffers@users.noreply.github.com> Date: Mon, 4 May 2026 17:22:46 +0100 Subject: [PATCH 3/3] Tidying up auto-close-pr's yml --- .github/workflows/auto-close-external-prs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/auto-close-external-prs.yml b/.github/workflows/auto-close-external-prs.yml index e2188a0..d8d2165 100644 --- a/.github/workflows/auto-close-external-prs.yml +++ b/.github/workflows/auto-close-external-prs.yml @@ -3,11 +3,10 @@ name: "Auto-Close External PRs" on: pull_request_target: types: [opened] - workflow_dispatch: jobs: close-on-open: - if: github.event_name == 'pull_request_target' && github.event.pull_request.user.login != github.repository_owner + if: github.event.pull_request.user.login != github.repository_owner runs-on: ubuntu-latest permissions: pull-requests: write