Skip to content

Check if trying to link from underneath a field #10

Check if trying to link from underneath a field

Check if trying to link from underneath a field #10

name: Telegram Notifications v2
on:
issues:
types: [opened, edited, closed]
issue_comment:
types: [created]
pull_request:
types: [opened, edited, closed, reopened]
pull_request_review_comment:
types: [created]
jobs:
send_notification:
runs-on: ubuntu-latest
steps:
- name: Build Telegram message (Issue)
if: ${{ github.event_name == 'issues' }}
shell: bash
env:
BODY: ${{ github.event.issue.body }}
ISSUE_URL: ${{ github.event.issue.html_url }}
ACTOR: ${{ github.actor }}
ACTION: ${{ github.event.action }}
TITLE: ${{ github.event.issue.title }}
run: |
ESCAPED_BODY=$(printf '%s' "$BODY" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ISSUE_URL=$(printf '%s' "$ISSUE_URL" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ACTOR=$(printf '%s' "$ACTOR" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ACTION=$(printf '%s' "$ACTION" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_TITLE=$(printf '%s' "$TITLE" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
cat > tg_message.html <<'EOF'
🚨 Issue Notification 🚨
EOF
{
echo "<b>Issue URL:</b> $ESCAPED_ISSUE_URL"
echo "<b>$ESCAPED_ACTOR</b> triggered issue event: <b>$ESCAPED_ACTION</b>"
echo "<b>Title:</b> $ESCAPED_TITLE"
echo "<blockquote>$ESCAPED_BODY</blockquote>"
} >> tg_message.html
- name: Send Telegram (Issue)
if: ${{ github.event_name == 'issues' }}
uses: appleboy/telegram-action@v1.0.1
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message_file: tg_message.html
- name: Build Telegram message (Issue Comment)
if: ${{ github.event_name == 'issue_comment' }}
shell: bash
env:
BODY: ${{ github.event.comment.body }}
COMMENT_URL: ${{ github.event.comment.html_url }}
ISSUE_URL: ${{ github.event.issue.html_url }}
ACTOR: ${{ github.actor }}
run: |
ESCAPED_COMMENT=$(printf '%s' "$BODY" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_COMMENT_URL=$(printf '%s' "$COMMENT_URL" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ISSUE_URL=$(printf '%s' "$ISSUE_URL" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ACTOR=$(printf '%s' "$ACTOR" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
cat > tg_message.html <<'EOF'
📝 Comment on Issue 📝
EOF
{
echo "<b>Comment URL:</b> $ESCAPED_COMMENT_URL"
echo "<b>Issue URL:</b> $ESCAPED_ISSUE_URL"
echo "<b>$ESCAPED_ACTOR</b> commented:"
echo "<blockquote>$ESCAPED_COMMENT</blockquote>"
} >> tg_message.html
- name: Send Telegram (Issue Comment)
if: ${{ github.event_name == 'issue_comment' }}
uses: appleboy/telegram-action@v1.0.1
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message_file: tg_message.html
- name: Build Telegram message (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
shell: bash
env:
BODY: ${{ github.event.pull_request.body }}
PR_URL: ${{ github.event.pull_request.html_url }}
ACTOR: ${{ github.actor }}
ACTION: ${{ github.event.action }}
TITLE: ${{ github.event.pull_request.title }}
run: |
ESCAPED_PR_BODY=$(printf '%s' "$BODY" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_PR_URL=$(printf '%s' "$PR_URL" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ACTOR=$(printf '%s' "$ACTOR" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ACTION=$(printf '%s' "$ACTION" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_TITLE=$(printf '%s' "$TITLE" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
cat > tg_message.html <<'EOF'
🚀 Pull Request Notification 🚀
EOF
{
echo "<b>PR URL:</b> $ESCAPED_PR_URL"
echo "<b>$ESCAPED_ACTOR</b> triggered PR event: <b>$ESCAPED_ACTION</b>"
echo "<b>Title:</b> $ESCAPED_TITLE"
echo "<blockquote>$ESCAPED_PR_BODY</blockquote>"
} >> tg_message.html
- name: Send Telegram (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
uses: appleboy/telegram-action@v1.0.1
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message_file: tg_message.html
- name: Build Telegram message (PR Comment)
if: ${{ github.event_name == 'pull_request_review_comment' }}
shell: bash
env:
BODY: ${{ github.event.comment.body }}
COMMENT_URL: ${{ github.event.comment.html_url }}
PR_URL: ${{ github.event.pull_request.html_url }}
ACTOR: ${{ github.actor }}
run: |
ESCAPED_COMMENT=$(printf '%s' "$BODY" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_COMMENT_URL=$(printf '%s' "$COMMENT_URL" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_PR_URL=$(printf '%s' "$PR_URL" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
ESCAPED_ACTOR=$(printf '%s' "$ACTOR" \
| tr -d '\r' \
| sed -e 's/&/\&amp;amp;/g' -e 's/</\&amp;lt;/g' -e 's/>/\&amp;gt;/g')
cat > tg_message.html <<'EOF'
💬 Comment on Pull Request 💬
EOF
{
echo "<b>Comment URL:</b> $ESCAPED_COMMENT_URL"
echo "<b>PR URL:</b> $ESCAPED_PR_URL"
echo "<b>$ESCAPED_ACTOR</b> commented:"
echo "<blockquote>$ESCAPED_COMMENT</blockquote>"
} >> tg_message.html
- name: Send Telegram (PR Comment)
if: ${{ github.event_name == 'pull_request_review_comment' }}
uses: appleboy/telegram-action@v1.0.1
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
disable_web_page_preview: true
message_file: tg_message.html