name: telegram message
on: [push]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: send custom message with args
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        args: The ${{ github.event_name }} event triggered first step.

    - name: send message useing with
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        message: |
          The ${{ github.event_name }} event triggered second step.
          show the github varable: ${{ github.ref }}

    - name: send default message
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}

    - name: send photo message
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        message: send photo message
        photo: './tests/github.png'
        document: './tests/gophercolor.png'

    - name: send location message
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        location: '24.9163213 121.1424972'
        venue: '35.661777 139.704051 竹北體育館 新竹縣竹北市'

    - name: send custom message
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        message: |
          The ${{ github.event_name }} event triggered final step.
          echo This event is a pull request that had an assignee removed.

    - name: send message file
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        message_file: tests/message.txt

    - name: send message using socks5 proxy URL
      uses: appleboy/telegram-action@master
      with:
        to: ${{ secrets.TELEGRAM_TO }}
        token: ${{ secrets.TELEGRAM_TOKEN }}
        socks5: "http://222.124.154.19:23500"
        message: Send message from socks5 proxy URL.
