Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove notify #502

Merged
merged 2 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,44 @@ jobs:
table.csv
first_aid_bot

notify:
runs-on: ubuntu-latest
needs: deploy
if: github.base_ref == 'main'

steps:
- uses: dawidd6/action-download-artifact@v2
with:
pr: ${{github.event.pull_request.number}}
workflow: CI.yml
name: apk

- name: send telegram message on push
uses: appleboy/telegram-action@master
if: always() && github.base_ref == 'main' && !contains(needs.*.result, 'failure')
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
document: app-release.apk
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}

See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}}
See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Successfully deployed! 🙆

- name: send telegram message on push
uses: appleboy/telegram-action@master
if: always() && github.base_ref == 'main' && contains(needs.*.result, 'failure')
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
document: table.csv
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}

See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}}
See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
The commit fails to build or tests have failed! 💣
# notify:
# runs-on: ubuntu-latest
# needs: deploy
# if: github.base_ref == 'main'
#
# steps:
# - uses: dawidd6/action-download-artifact@v2
# with:
# pr: ${{github.event.pull_request.number}}
# workflow: CI.yml
# name: apk
#
# - name: send telegram message on push
# uses: appleboy/telegram-action@master
# if: always() && github.base_ref == 'main' && !contains(needs.*.result, 'failure')
# with:
# to: ${{ secrets.TELEGRAM_TO }}
# token: ${{ secrets.TELEGRAM_TOKEN }}
# document: app-release.apk
# message: |
# ${{ github.actor }} created commit:
# Commit message: ${{ github.event.commits[0].message }}
#
# See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}}
# See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
# Successfully deployed! 🙆
#
# - name: send telegram message on push
# uses: appleboy/telegram-action@master
# if: always() && github.base_ref == 'main' && contains(needs.*.result, 'failure')
# with:
# to: ${{ secrets.TELEGRAM_TO }}
# token: ${{ secrets.TELEGRAM_TOKEN }}
# document: table.csv
# message: |
# ${{ github.actor }} created commit:
# Commit message: ${{ github.event.commits[0].message }}
#
# See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}}
# See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
# The commit fails to build or tests have failed! 💣
12 changes: 4 additions & 8 deletions bot/src/bot/dialogue/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::bot::{FABot, FADialogue};
use crate::{DataGetState, DATA, REDIS_CONN, REDIS_USERS_SET_KEY};
use anyhow::{anyhow, Context, Error};
use first_aid_bot_core::prelude::*;
use redis::{aio::MultiplexedConnection, AsyncCommands};
use redis::AsyncCommands;
use teloxide::dispatching::DpHandlerDescription;
use teloxide::prelude::*;
use teloxide::types::ParseMode::Html;
Expand Down Expand Up @@ -109,11 +109,7 @@ pub fn get_commands_branch() -> FAHandler {
}

pub fn get_maintainer_commands_branch() -> FAHandler {
dptree::filter(
|msg: Message, _bot: FABot, _data: &'static Data, _conn: MultiplexedConnection| {
cfg!(debug_assertions) || is_admin(&msg)
},
)
.filter_command::<MaintainerCommands>()
.endpoint(maintainer_commands_handler)
dptree::filter(|msg: Message, _bot: FABot| cfg!(debug_assertions) || is_admin(&msg))
.filter_command::<MaintainerCommands>()
.endpoint(maintainer_commands_handler)
}
Loading