mirror of
https://github.com/Lifailon/lazyjournal.git
synced 2026-11-11 01:09:46 +01:00
927fa5708b
Bumps the go-dependencies group with 3 updates: [actions/ai-inference](https://github.com/actions/ai-inference), [github/codeql-action](https://github.com/github/codeql-action) and [snyk/actions/setup](https://github.com/snyk/actions). Updates `actions/ai-inference` from 2.1.1 to 3 - [Release notes](https://github.com/actions/ai-inference/releases) - [Commits](https://github.com/actions/ai-inference/compare/v2.1.1...v3) Updates `github/codeql-action` from 4.37.3 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v4.37.3...v4.39.1) Updates `snyk/actions/setup` from 8e119fbb6c251787721d34ba683ed48eba792766 to 11b673cfb4b0dc0d860a1323caa199d54950dcce - [Release notes](https://github.com/snyk/actions/releases) - [Commits](https://github.com/snyk/actions/compare/8e119fbb6c251787721d34ba683ed48eba792766...11b673cfb4b0dc0d860a1323caa199d54950dcce) --- updated-dependencies: - dependency-name: actions/ai-inference dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major dependency-group: go-dependencies - dependency-name: github/codeql-action dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies - dependency-name: snyk/actions/setup dependency-version: 11b673cfb4b0dc0d860a1323caa199d54950dcce dependency-type: direct:production dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
123 lines
4.2 KiB
YAML
123 lines
4.2 KiB
YAML
name: "[AI] Issue notify"
|
|
|
|
on:
|
|
issues:
|
|
types: [opened, closed, reopened]
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
run-name: "Issue #${{ github.event.issue.number }}: ${{ github.event.issue.title }}"
|
|
|
|
jobs:
|
|
issue_review:
|
|
permissions:
|
|
issues: write
|
|
models: read
|
|
contents: read
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository (main branch and last commits)
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 1
|
|
ref: main
|
|
|
|
- name: Escape markdown characters
|
|
id: escape
|
|
continue-on-error: true
|
|
env:
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
EVENT_ACTION: ${{ github.event.action }}
|
|
ISSUE_TITLE: ${{ github.event.issue.title }}
|
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
ISSUE_BODY: ${{ github.event.issue.body }}
|
|
run: |
|
|
ACTION=$(echo "$EVENT_NAME $EVENT_ACTION" | sed 's/_/\\_/g')
|
|
TITLE=$(echo "$ISSUE_TITLE" | sed 's/_/\\_/g')
|
|
if [ -n "$COMMENT_BODY" ]; then
|
|
DESCRIPTION=$(echo "$COMMENT_BODY" | sed 's/_/\\_/g')
|
|
else
|
|
DESCRIPTION=$(echo "$ISSUE_BODY" | sed 's/_/\\_/g')
|
|
fi
|
|
{
|
|
echo "action<<EOF"
|
|
echo "$ACTION"
|
|
echo "EOF"
|
|
|
|
echo "title<<EOF"
|
|
echo "$TITLE"
|
|
echo "EOF"
|
|
|
|
echo "description<<EOF"
|
|
echo "$DESCRIPTION"
|
|
echo "EOF"
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Send message to Telegram
|
|
id: tg_msg
|
|
uses: appleboy/telegram-action@master
|
|
continue-on-error: true
|
|
with:
|
|
token: ${{ secrets.TELEGRAM_API_TOKEN }}
|
|
to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
|
|
debug: true
|
|
format: markdown
|
|
message: |
|
|
🔔 **Action**: ${{ steps.escape.outputs.action }} [#${{ github.event.issue.number }}](${{ github.event.comment.html_url || github.event.issue.html_url }})
|
|
|
|
📁 **Repository**: ${{ github.repository }}
|
|
👤 **From user**: ${{ github.actor }}
|
|
|
|
📌 **Title**: ${{ steps.escape.outputs.title || github.event.issue.title }}
|
|
💬 **Description**:
|
|
${{ steps.escape.outputs.description }}
|
|
|
|
- name: Send message to Telegram if there is an error sending the description
|
|
uses: appleboy/telegram-action@master
|
|
if: failure()
|
|
continue-on-error: true
|
|
with:
|
|
token: ${{ secrets.TELEGRAM_API_TOKEN }}
|
|
to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
|
|
debug: true
|
|
format: markdown
|
|
message: |
|
|
🔔 **Action**: ${{ steps.escape.outputs.action }} [#${{ github.event.issue.number }}](${{ github.event.comment.html_url || github.event.issue.html_url }})
|
|
|
|
📁 **Repository**: ${{ github.repository }}
|
|
👤 **From user**: ${{ github.actor }}
|
|
|
|
📌 **Title**: ${{ steps.escape.outputs.title || github.event.issue.title }}
|
|
|
|
- name: Generate report using AI
|
|
if: ${{ github.event_name == 'issues' && github.event.action == 'opened'}}
|
|
id: ai_query
|
|
uses: actions/ai-inference@v3
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
endpoint: https://models.github.ai/inference
|
|
model: gpt-4.1
|
|
max-tokens: 8192
|
|
system-prompt: |
|
|
You are a technical writer (issue reviewer) in Russian.
|
|
Analyze the issue and propose several possible solutions for implementation.
|
|
The response must be strictly in Markdown format and adhere to the 3500 character limit for sending messages in Telegram.
|
|
prompt: |
|
|
Title: ${{ steps.escape.outputs.title || github.event.issue.title }}
|
|
💬 **Description**:
|
|
${{ steps.escape.outputs.description }}
|
|
|
|
- name: Send AI report to Telegram
|
|
uses: appleboy/telegram-action@master
|
|
continue-on-error: true
|
|
with:
|
|
token: ${{ secrets.TELEGRAM_API_TOKEN }}
|
|
to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
|
|
debug: true
|
|
format: markdown
|
|
message: |
|
|
🔔 Report for ${{ github.event.issue.number }} issue from AI
|
|
|
|
${{ steps.ai_query.outputs.response }} |