Created
December 22, 2022 09:45
-
-
Save deep5050/47a59f3d034fdfb7fb9546cd86831675 to your computer and use it in GitHub Desktop.
book_quotes_on_new_issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
comment_quote: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Fetch book quotes | |
run: | | |
curl https://raw.githubusercontent.com/<username>/<repository>/master/quotes.json --output quotes.json | |
- name: Select random quote | |
run: | | |
quote=$(jq -r '.quotes[$RANDOM % length] | .quote' quotes.json) | |
author=$(jq -r '.quotes[$RANDOM % length] | .author' quotes.json) | |
title=$(jq -r '.quotes[$RANDOM % length] | .title' quotes.json) | |
echo "\"$quote\" - $author ($title)" | |
- name: Comment on issue | |
uses: peter-evans/create-or-update-issue-comment@v2 | |
with: | |
body: "\"$quote\" - $author ($title)" | |
issue-number: ${{ github.event.issue.number }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment