Skip to content

Instantly share code, notes, and snippets.

@tobyapi
Last active July 1, 2025 16:53
Show Gist options
  • Select an option

  • Save tobyapi/b402e86c76498c2e95db8eb0a2b39b90 to your computer and use it in GitHub Desktop.

Select an option

Save tobyapi/b402e86c76498c2e95db8eb0a2b39b90 to your computer and use it in GitHub Desktop.
任意 prompt を gemini に投げてから discord webhook に投げる gha
on:
schedule:
- cron: '0 3 * * *'
jobs:
message:
runs-on: ubuntu-latest
outputs:
geminiResult: ${{ steps.set_output.outputs.value }}
steps:
- name: Deep Research by Gemini
id: deep-research
run: |
echo 'GEMINI_RESULT<<EOF' >> $GITHUB_OUTPUT
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${{ secrets.GEMINI_API_KEY }}" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"contents": [
{
"parts": [
{
"text": "${{ vars.GEMINI_PROMPT }}"
}
]
}
],
"tools": [{"google_search": {}}]
}' | jq -r .candidates[].content.parts[].text >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
- name: Discord Webhook Action
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
content: ${{ steps.deep-research.outputs.GEMINI_RESULT }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment