From 46b7d4ca7ab1dcf15e65d14886ba648782063d75 Mon Sep 17 00:00:00 2001 From: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> Date: Tue, 3 Dec 2024 19:03:18 +0100 Subject: [PATCH] ci: Fix publish-snapshot not respecting all includes --- .github/workflows/publish-snapshot.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 111a63e5..ef34a81d 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -19,14 +19,15 @@ jobs: script: | const fs = require('fs'); const settingsGradle = fs.readFileSync('settings.gradle', 'utf8'); - const includePattern = /^(?!\s*\/\/)\s*include\s*\(\s*["']([^"']+)["']\s*\)/gm; - const includes = [...settingsGradle.matchAll(includePattern)].map(match => match[1]); + const includePattern = /^(?!\s*\/\/)\s*include\s*\(\s*(['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])*\s*)\)/gm; + const includes = [...settingsGradle.matchAll(includePattern)] + .flatMap(match => match[0].match(/['"]([^'"]+)['"]/g).map(item => item.replace(/['"]/g, ''))); const includeFabric = includes.includes('fabric'); const includeForge = includes.includes('forge'); const includeNeoForge = includes.includes('neoforge'); return { loader: ['common', includeFabric ? 'fabric' : false, includeForge ? 'forge' : false, includeNeoForge ? 'neoforge' : false].filter(Boolean), - } + }; publish-snapshot: runs-on: ubuntu-latest strategy: