DEV Community

Mark Tse
Mark Tse

Posted on • Updated on

Stack Overflow Search GitHub Action

My Workflow

I created a new GitHub action that allows anyone to search on Stack Overflow via an issue or pull request comment. I created a workflow that uses this action so that you can try it out on this issue or pull request!

Usage: /so <query>

Submission Category:

Wacky Wildcards

Yaml File or Link to Code

on:
  issue_comment:
    types: [created]

jobs:
  ask-stackoverflow:
    runs-on: ubuntu-latest
    steps:
      - uses: neverendingqs/gh-action-ask-stackoverflow@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

GitHub logo neverendingqs / gh-action-ask-stackoverflow

Search Stack Overflow on issues and pull requests using this GitHub Action.

gh-action-ask-stackoverflow

Search Stack Overflow on issues and pull requests using this GitHub Action.

Usage

Set up a workflow to pull in this action:

on:
  issue_comment:
    types: [created]

jobs:
  ask-stackoverflow:
    runs-on: ubuntu-latest
    steps:
      - uses: neverendingqs/gh-action-ask-stackoverflow@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

​‌‌​​‌​‌ ​‌‌‌​‌‌​ ​‌‌​​‌​‌ ​‌‌‌​​‌​ ​‌‌​​‌​‌ ​‌‌​‌‌‌​ ​‌‌​​‌​​ ​‌‌​‌​​‌ ​‌‌​‌‌‌​ ​‌‌​​‌‌‌ ​‌‌‌​​​‌ ​‌‌‌​​‌‌

Then search anything on Stack Overflow using the /so command, and the action will post back with the top 3 matching results, each with the top 3 answers.

Try it out by running the /so command on this issue or pull request!

Additional Resources / Info

Top comments (3)

Collapse
 
waylonwalker profile image
Waylon Walker

This is super cool! I might use this as an example of something useful. I made a comment and it responded back really quick.

Collapse
 
hedyhli profile image
hedy

hey, I think this is great, I'm gonna try it on the playground right away 😃

Collapse
 
vadorequest profile image
Vadorequest

Fun!