Files
leetcode/.github/workflows/close-topics.yml
T

45 lines
1.3 KiB
YAML

name: Close Topics
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 }}