This commit is contained in:
2026-01-30 14:56:48 +03:00
parent 88ab265755
commit edd70ad020

View File

@@ -209,16 +209,14 @@ jobs:
notify_diffs: notify_diffs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: github.event_name == 'push' && github.ref == 'refs/heads/main'
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true)
needs: parse needs: parse
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: ${{ env.GIT_DEPTH }} fetch-depth: 0
- name: Configure Git for github-actions[bot] - name: Configure Git
run: | run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
@@ -226,15 +224,18 @@ jobs:
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.9' python-version: '3.9'
- name: Install Python dependencies - name: Install dependencies
run: pip install aiohttp run: pip install aiohttp
- name: Send module diffs to channel - name: Send module diffs to channel
env: env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID_UPDATE }} TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID_UPDATE }}
run: | run: |
git fetch origin main LAST_COMMIT_MESSAGE=$(git log -1 --pretty=%B)
python3 update_diffs.py --token ${{ secrets.TELEGRAM_BOT_TOKEN }} --chat_id ${{ secrets.TELEGRAM_CHAT_ID_UPDATE }} --base_commit HEAD~1 if [[ "$LAST_COMMIT_MESSAGE" == Merge* ]]; then
python3 update_diffs.py --token ${{ secrets.TELEGRAM_BOT_TOKEN }} --chat_id ${{ secrets.TELEGRAM_CHAT_ID_UPDATE }} --base_commit HEAD~1
fi
backup: backup:
runs-on: ubuntu-latest runs-on: ubuntu-latest