Skip to content

Please tell what is the dragons look like? #4

Please tell what is the dragons look like?

Please tell what is the dragons look like? #4

name: generate-on-issues
on:
issues:
types:
- opened
- reopened
- labeled
jobs:
generate-on-issues:
if: startsWith(github.event.issue.title, 'Please') || github.event.label.name == 'generate'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
# Checkout the main branch
- uses: actions/checkout@v4
# Uses action in the root directory to generate awesome text
- name: Generate awesome text
uses: huuquyet/generate-awesome-text@main
env:
GEMINI_API_TOKEN: ${{ secrets.GEMINI_API_TOKEN }}
with:
prompt: ${{ github.event.issue.title }}
# user: ${{ github.event.issue.user.login }}
# Push awesome text to main branch
# Note: the following account information will not work on GHES
- name: Push the awesome text to main branch
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m ":robot: Generated by @$USER (#$NUMBER)"
git push
env:
NUMBER: ${{ github.event.issue.number }}
USER: ${{ github.event.issue.user.login }}
- name: Add comment
run: |
gh issue comment "$NUMBER" --body "$BODY"
gh issue close "$NUMBER"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
BODY: >
Done!
**Your request was generated**
:sparkles: Thank you for your contribution! :sparkles: