Skip to content

Commit

Permalink
Adding the explanation of the action in the READM
Browse files Browse the repository at this point in the history
  • Loading branch information
danilat committed Apr 11, 2020
1 parent f3c2e00 commit b1895a8
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
# Hello world JavaScript action
# Externalized Telegram Notifications-action action

This action prints "Hello World" or "Hello" + the name of a person to greet to the log. To learn how this action was built, see "[Creating a JavaScript action](https://help.github.com/en/articles/creating-a-javascript-action)" in the GitHub Help documentation.
[GitHub Action](https://github.com/features/actions) that send messages to Telegram, previously retrieves the message content from an external url. Html (default mode) or markdown formats are both supporte in the retrieved content for the message.

## Inputs
The purpose of this action is get a changelog with the changes from an external url and send it to a telegram channel.

### `who-to-greet`

**Required** The name of the person to greet. Default `"World"`.

## Outputs

### `time`

The time we greeted you.
You should add cofigurations for: `to` with a channel id or a chat id , `token` with your telegram token, `content-url` with a public accesible url that has the content that you cant to send. Optionally you can send the `parse_mode` that it'll be used for telegram API.

## Example usage

```yaml
uses: actions/hello-world-javascript-action@master
with:
who-to-greet: 'Mona the Octocat'
name: Send notifications to telegram
on:
push
jobs:
build:
name: A job to launch telegram notifications
runs-on: ubuntu-latest
steps:
- name: Send notifications
id: send_notificsations
uses: danilat/externalized-telegram-notifications-action@master
with:
to: ${{ secrets.TELEGRAM_ID_OR_CHANNEL }}
token: ${{ secrets.TELEGRAM_TOKEN }}
content-url: ${{ secrets.CONTENT_URL }}
parse_mode: html
```

## Considerations

- You'll get the telegram token [when you create your bot using the BotFather](https://core.telegram.org/bots#3-how-do-i-create-a-bot).
- If you want send messages for a channel you should use `@channelname` in `to` variable.
- If you want send messages to a user you need the id of the conversation using, you can get it with `curl https://api.telegram.org/bot<telegram_token>/getUpdates`.
- In the content that responds to `content-url` you should use only the [supported formatting options](https://core.telegram.org/bots/api#formatting-options).

0 comments on commit b1895a8

Please sign in to comment.