mirror of
https://github.com/Flowseal/tg-ws-proxy.git
synced 2026-11-01 02:06:58 +03:00
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: Auto comment on new issues
|
|
|
|
on:
|
|
issues:
|
|
types: [opened]
|
|
|
|
permissions:
|
|
issues: write
|
|
contents: read
|
|
|
|
jobs:
|
|
comment:
|
|
if: contains(github.event.issue.labels.*.name, 'bug')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check for availability log file
|
|
id: log
|
|
env:
|
|
ISSUE_BODY: ${{ github.event.issue.body }}
|
|
run: |
|
|
if [[ "$ISSUE_BODY" =~ (https://github\.com/user-attachments/files/[^[:space:]]+\.log) ]]; then
|
|
echo "found=true" >> "$GITHUB_OUTPUT"
|
|
echo "url=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
|
|
echo "Log file found"
|
|
else
|
|
echo "found=false" >> "$GITHUB_OUTPUT"
|
|
echo "Log file not found"
|
|
fi
|
|
|
|
- name: Install python
|
|
if: steps.log.outputs.found == 'true'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.14"
|
|
|
|
- name: Clone folder
|
|
if: steps.log.outputs.found == 'true'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
sparse-checkout: |
|
|
.github/scripts/*
|
|
sparse-checkout-cone-mode: false
|
|
|
|
- name: Start check log
|
|
if: steps.log.outputs.found == 'true'
|
|
id: comment
|
|
env:
|
|
LOG_URL: ${{ steps.log.outputs.url }}
|
|
run: |
|
|
{
|
|
echo "com<<EOF"
|
|
python .github/scripts/check_log.py
|
|
echo "EOF"
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Comment on new issue
|
|
uses: peter-evans/create-or-update-comment@v5
|
|
with:
|
|
issue-number: ${{ github.event.issue.number }}
|
|
body-path: ${{ steps.log.outputs.found == 'true' && steps.comment.outputs.com || '.github/scripts/answers/default.md' }} |