Skip to content

Commit

Permalink
Telegram: Use custom bash snippet instead of xinthink step
Browse files Browse the repository at this point in the history
  • Loading branch information
sounddrill31 authored Jun 26, 2024
1 parent 669247b commit 869eb08
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 16 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,18 @@ jobs:
# Send Build 'start' notification
- name: Telegram Notification
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has been queued %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: "Build Started"
Expand Down Expand Up @@ -422,8 +432,19 @@ jobs:
- name: Telegram Notification
if: ${{ success() || cancelled() || failure() }}
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has status: $status %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
# Todo: error.log link
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: ${{ job.status }}
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/selfhosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,18 @@ jobs:
# Send Build 'start' notification
- name: Telegram Notification
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has been queued %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: "Build Started"
Expand Down Expand Up @@ -449,8 +459,19 @@ jobs:
- name: Telegram Notification
if: ${{ success() || cancelled() || failure() }}
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has status: $status %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
# Todo: error.log link
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: ${{ job.status }}
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/twrp-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,18 @@ jobs:
# Send Build 'start' notification
- name: Telegram Notification
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has been queued %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: "Build Started"
Expand Down Expand Up @@ -351,8 +361,19 @@ jobs:
- name: Telegram Notification
if: ${{ success() || cancelled() || failure() }}
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has status: $status %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
# Todo: error.log link
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: ${{ job.status }}
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/twrp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,18 @@ jobs:
# Send Build 'start' notification
- name: Telegram Notification
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has been queued %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: "Build Started"
Expand Down Expand Up @@ -351,8 +361,19 @@ jobs:
- name: Telegram Notification
if: ${{ success() || cancelled() || failure() }}
continue-on-error: true
uses: xinthink/action-telegram@v1.1
with:
run: |
send_telegram_message() {
local message="$1"
curl -s -X POST \
https://api.telegram.org/botbotToken/sendMessage \
-d chat_id=chatId \
-d text="$message" \
-d parse_mode="Markdown"
}
send_telegram_message "Crave ProjectID: $PROJECTID %0ABuild for ${{ github.event.inputs.DEVICE_NAME }} has status: $status %0ACheck Progress at: %0Ahttps://github.com/sounddrill31/crave_aosp_builder/actions/runs/${{ github.run_id }}"
# Todo: error.log link
env:
chatId: ${{ secrets.TELEGRAM_TO }}
botToken: ${{ secrets.TELEGRAM_TOKEN }}
jobStatus: ${{ job.status }}
Expand Down

0 comments on commit 869eb08

Please sign in to comment.