fix: don't run close-dupes workflow unnecessarily

It would fail on other-category discussions and apparently email the thread OP about it lol
This commit is contained in:
bo0tzz 2025-08-27 11:01:59 +02:00 committed by GitHub
parent 76eaee3657
commit d85d73ea24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,8 +8,18 @@ name: Close likely duplicates
permissions: {} permissions: {}
jobs: jobs:
should_run:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.should_run.outputs.run }}
steps:
- id: should_run
run: echo "run=${{ github.event_name == 'issues' || github.event.discussion.category.name == 'Feature Request' }}" >> $GITHUB_OUTPUT
get_body: get_body:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: should_run
if: ${{ needs.should_run.outputs.should_run == 'true' }}
env: env:
EVENT: ${{ toJSON(github.event) }} EVENT: ${{ toJSON(github.event) }}
outputs: outputs:
@ -22,7 +32,8 @@ jobs:
get_checkbox_json: get_checkbox_json:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get_body needs: [get_body, should_run]
if: ${{ needs.should_run.outputs.should_run == 'true' }}
container: container:
image: yshavit/mdq:0.8.0@sha256:c69224d34224a0043d9a3ee46679ba4a2a25afaac445f293d92afe13cd47fcea image: yshavit/mdq:0.8.0@sha256:c69224d34224a0043d9a3ee46679ba4a2a25afaac445f293d92afe13cd47fcea
outputs: outputs:
@ -37,8 +48,8 @@ jobs:
close_and_comment: close_and_comment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: get_checkbox_json needs: [get_checkbox_json, should_run]
if: ${{ !fromJSON(needs.get_checkbox_json.outputs.json).items[0].list[0].checked }} if: ${{ needs.should_run.outputs.should_run == 'true' && !fromJSON(needs.get_checkbox_json.outputs.json).items[0].list[0].checked }}
permissions: permissions:
issues: write issues: write
discussions: write discussions: write