DEV Community

Cover image for Releasing the funniest GitHub Action & Workflow
Alex Lakatos 🥑
Alex Lakatos 🥑

Posted on

Releasing the funniest GitHub Action & Workflow

I happen to maintain one of the popular Hacktoberfest repositories. It's the easiest way to make a valid Hacktoberfest Contribution (without spamming). To put it into context, it got more PRs during the first 24 hours of Hacktoberfest than it got the rest of the year.

And I'm extremely grateful for that! It's a repository of the most cringe-worthy computer puns on the internet. I take all the help I can to gather them. Someone on Twitter gave me the idea, I had way too much time on my hands, so now you can add a GitHub Action to your Workflows that outputs a pun and punchline.

GitHub logo AlexLakatos / puns-dev-action

GitHub Action from pus.dev

puns.dev Action

This action prints a random pun from a hand-picked selection of the worst computer puns on the Internet, really cringe-worthy stuff.

Outputs

pun

The random pun.

punchline

The corresponding punchline.

Example usage

uses: actions/puns-dev-action@v1.3




What about the Workflow?

The action usage is a one-liner, I tried to make it as painless to use as I can, for such a small action.

uses: AlexLakatos/puns-dev-action@v1.3

The action returns text, so the workflow possibilities are quite literally endless. It works really well with other GitHub related actions. My favourite combination, and the one I use on my side projects and the original repository, is to add a comment to each new PR, thanking people for contributing, and giving them a pun in return.

Submission Category?

While I can make a definite case this workflow is one of the "Maintainer Must-Haves", I'm not sure everyone would agree 😅. It definitely is one of the Wacky Wildcards.

Yaml File

name: PR Puns

on:
  pull_request_target:
    types: [ opened ]

jobs:
  punny:
    runs-on: ubuntu-latest
    name: Reward PRs with a random pun
    steps:
    - uses: AlexLakatos/puns-dev-action@v1.3
      id: pun
    - uses: allthatjazzleo/actions-pull-request-add-comment@v1
      with:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        message: |
          Thank you for submitting a PR! Here's a pun, while you wait for us to review your PR.

          ${{ steps.pun.outputs.pun }}
          ${{ steps.pun.outputs.punchline }}    
Enter fullscreen mode Exit fullscreen mode

Top comments (0)