Skip to content

shokme/giphy-generator

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

GIPHY Generator - GitHub Action.

A GitHub Action (written in JavaScript) to generate a gif based on a query string, leveraging the GIPHY API. Powered by GIPHY and GitHub Actions!

This is repo is based on the work of @IAmHughes

Usage

Pre-requisites

Create a workflow .yml file in your .github/workflows directory. An example workflow is available below.

Inputs

For more information on these inputs, see the GIPHY API Documentation.

  • query: The search term that search query term or phrase. Required
  • rating: The content rating used to filter results from the GIF search. Default: g
  • lang: The default language that the search query is in. Default: en for English

Example workflow - giphy generator

name: Discord Notification

on:
  push:
    branches: [ staging ]

jobs:
  giphyGenerator:
    name: Giphy Generator
    runs-on: ubuntu-latest
    outputs:
      url: ${{ steps.giphy_generator.outputs.url }}
    steps:
      - name: Giphy Generator
        id: giphy_generator
        uses: shokme/giphy-generator@v1.1
        env:
          GIPHY_TOKEN: ${{ secrets.GIPHY_TOKEN }}
  discordNotification:
    name: Discord Notification
    runs-on: ubuntu-latest
    needs: giphyGenerator
    steps:
    - uses: actions/checkout@v2
    - name: Discord Notification
      uses: Ilshidur/action-discord@0.3.2
      with:
        args: ${{ needs.giphyGenerator.outputs.url }}
      env:
        DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
        DISCORD_USERNAME: DeployInProgress

Contributing

Pull requests are welcome! Please see the CONTRIBUTING.md for more information.

License

The scripts and documentation in this project are released under the GNU License

Disclaimer

This leverages the GIPHY API to query results based on inputs you provide and the rating you use. As a consumer of this action, you accept responsibility of any gifs that are posted by this bot. The owner of this action does not control the search algorithm or endpoint that is returning images and is not responsible for it's content.

About

A GitHub Action to generate a gif url that can be used by your other actions

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%