name: Close Topics # No D1 push here, unlike Close Solved: D1 stores no topic completion column. # Phase progress, the gate pools and the charts all derive from the problem # rows, which close-solved already logs — a topic is finished exactly when its # core problems are, so there is nothing left to reconcile. on: # Close Solved closes problem issues with GITHUB_TOKEN, and token-driven # closes never fire `issues` events — so chain off its run instead. # Conclusion is not filtered: the script reconciles state, so running after a # partially successful run is safe and catches whatever it did close. workflow_run: workflows: [Close Solved] types: [completed] # Covers problem issues closed by hand in the UI. issues: types: [closed] workflow_dispatch: inputs: dry_run: description: Report finished topics without closing anything type: boolean default: false permissions: contents: read issues: write concurrency: group: close-topics cancel-in-progress: false jobs: close: # The `issues` trigger fires for every issue in the repo; only closing a # problem sub-issue can ever complete a topic's core set. if: github.event_name != 'issues' || contains(github.event.issue.labels.*.name, 'problem') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 # No install step: the script only uses Bun builtins + fetch. - run: bun apps/cli/close-topics.ts env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DRY_RUN: ${{ inputs.dry_run }}