A GitHub Action (written in JavaScript) to generate a comment on issues and PRs, responding to the command /giphy <search_term>
, leveraging the GIPHY API. Powered by GIPHY and GitHub Actions!
For example, if you commented on an Issue and included the phrase /giphy another one
, you would see a comment from this action of a gif response from GIPHY's Search API for another one
:
This repo isn't actively maintained, and may contain bugs. PRs welcome, though this was a fun PoC project.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below. For more information, reference the GitHub Help Documentation for Creating a workflow file.
For more information on these inputs, see the GIPHY API Documentation.
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
When an issue or pull_request has a new comment that contains the /giphy <search_term>
phrase (or is opened/edited), and add a comment powered by GIPHY to add a GIF using the given search phrase:
on:
issues:
types: [opened, edited]
pull_request:
types: [opened, edited]
issue_comment:
types: [created, edited]
name: GIPHY Generator
jobs:
giphy-generator:
name: GIPHY Generator
runs-on: ubuntu-latest
steps:
- name: GIPHY Generator
id: giphy_generator
uses: iamhughes/giphy-generator@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
GIPHY_TOKEN: ${{ secrets.GIPHY_TOKEN }} # This token should be created on giphy.com: https://developers.giphy.com/dashboard/?create=true
with:
rating: 'g'
lang: 'en'
I would love for you to contribute, pull requests are welcome! Please see the CONTRIBUTING.md for more information.
The scripts and documentation in this project are released under the GNU License
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.