diff --git a/.github/scripts/__tests__/challenge-doc-consistency.test.js b/.github/scripts/__tests__/challenge-doc-consistency.test.js index b29bbb2..7b114c7 100644 --- a/.github/scripts/__tests__/challenge-doc-consistency.test.js +++ b/.github/scripts/__tests__/challenge-doc-consistency.test.js @@ -117,11 +117,25 @@ test('generated podcast scripts avoid stale boilerplate', () => { 'Episode coming soon' ]; - const scriptFiles = fs.readdirSync(podcastScriptsDir).filter(name => name.endsWith('.txt')); + function collectTxtFiles(dir) { + const results = []; + for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + const fullPath = path.join(dir, entry.name); + if (entry.isDirectory()) { + results.push(...collectTxtFiles(fullPath)); + } else if (entry.name.endsWith('.txt')) { + results.push(fullPath); + } + } + return results; + } + + const scriptFiles = collectTxtFiles(podcastScriptsDir); assert.ok(scriptFiles.length > 0, 'podcasts/scripts should contain generated script files'); - scriptFiles.forEach(fileName => { - const script = fs.readFileSync(path.join(podcastScriptsDir, fileName), 'utf8'); + scriptFiles.forEach(filePath => { + const script = fs.readFileSync(filePath, 'utf8'); + const fileName = path.relative(podcastScriptsDir, filePath); bannedFragments.forEach(fragment => { assert.equal( script.includes(fragment), diff --git a/.github/workflows/registration.yml b/.github/workflows/registration.yml index 9ab2030..01d3b0b 100644 --- a/.github/workflows/registration.yml +++ b/.github/workflows/registration.yml @@ -147,8 +147,7 @@ jobs: if: >- steps.dup-check.outputs.is_duplicate == 'false' && steps.capacity-check.outputs.is_full == 'false' && - vars.CLASSROOM_ORG != '' && - secrets.CLASSROOM_ORG_ADMIN_TOKEN != '' + vars.CLASSROOM_ORG != '' uses: actions/github-script@v7 env: CLASSROOM_ORG: ${{ vars.CLASSROOM_ORG }}