Skip to content

add share to all projects + rename package.json + fallbacks #253

add share to all projects + rename package.json + fallbacks

add share to all projects + rename package.json + fallbacks #253

Workflow file for this run

name: Telegram Push Notification
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Find Pull Request
id: find_pr
run: |
# Get the pull request number and title
pr_number=$(jq --raw-output .number $GITHUB_EVENT_PATH)
pr_title=$(jq --raw-output .pull_request.title $GITHUB_EVENT_PATH)
pr_html_url=$(jq --raw-output .pull_request.html_url $GITHUB_EVENT_PATH)
# Set the output variables
echo "::set-output name=pull_request_number::$pr_number"
echo "::set-output name=pull_request_title::$pr_title"
echo "::set-output name=pull_request_html_url::$pr_html_url"
- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get Latest Commit Message and URL
id: commit_info
run: |
COMMIT_MESSAGE=$(git log --format=%B -n 1)
COMMIT_URL=$(git log --format=%H -n 1)
NUM_FILES_CHANGED=$(git --no-pager diff --name-only origin/main...${{ github.event.pull_request.base.ref }} | wc -l)
echo ::set-output name=num_files_changed::$NUM_FILES_CHANGED
echo ::set-output name=commit_message::$COMMIT_MESSAGE
echo ::set-output name=commit_url::https://github.com/${{ github.repository }}/commit/${COMMIT_URL}
echo ::set-output name=files_url::https://github.com/${{ github.repository }}/pull/${{ steps.find_pr.outputs.pull_request_number }}/files
- name: Telegram Notify
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
**examples** ⬆️ PUSH
Branch: [${{github.head_ref}}](https://github.com/mintbase/examples/tree/${{github.head_ref}})
Pull Request: [#${{ steps.find_pr.outputs.pull_request_number }} ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})
Commit: [${{ steps.commit_info.outputs.commit_message }}](${{ steps.commit_info.outputs.commit_url }})
Author: ${{ github.actor }}