Skip to content

Commit

Permalink
Create similarissues.yml (#2851)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed May 3, 2024
1 parent 8a59d53 commit bfd166e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/similarissues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Find Similar Issues

on:
issues:
types: [opened]
issue_comment:
types: [created]

jobs:
getSimilarIssues:
runs-on: ubuntu-latest
if: >-
(github.event_name == 'issues' && github.event.action == 'opened') ||
(github.event_name == 'issue_comment' && github.event.action == 'created' && startsWith(github.event.comment.body, '/similarissues'))
outputs:
message: ${{ steps.getBody.outputs.message }}
steps:
- id: getBody
uses: craigloewen-msft/GitGudSimilarIssues@main
with:
issueTitle: ${{ github.event.issue.title }}
issueBody: ${{ github.event.issue.body }}
repo: ${{ github.repository }}
similaritytolerance: "0.70"
add-comment:
needs: getSimilarIssues
runs-on: ubuntu-latest
permissions:
issues: write
if: needs.getSimilarIssues.outputs.message != ''
steps:
- name: Add comment
run: gh issue comment "$NUMBER" --repo "$REPO" --body "$BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUMBER: ${{ github.event.issue.number }}
REPO: ${{ github.repository }}
BODY: ${{ needs.getSimilarIssues.outputs.message }}

0 comments on commit bfd166e

Please sign in to comment.