A-d-r-i/update_choco_packages

Personnal update notification

Closed this issue · 1 comments

Add in PACKAGENAME.yml

      - name: Script
        env:
          TELEGRAM: ${{ secrets.TELEGRAM }}
          CHAT_ID: ${{ secrets.CHAT_ID }}

Add in send_PACKAGENAME.ps1 :

#send telegram notification
Function Send-Telegram {
Param([Parameter(Mandatory=$true)][String]$Message)
$Telegramtoken = "$env:TELEGRAM"
$Telegramchatid = "$env:CHAT_ID"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$Response = Invoke-RestMethod -Uri "https://api.telegram.org/bot$($Telegramtoken)/sendMessage?chat_id=$($Telegramchatid)&text=$($Message)"}

Send-Telegram -Message "[UCP] New update of PACKAGENAME : $tag"

Added, if necessary: https://api.telegram.org/bot<TELEGRAM_TOKEN>/getUpdates