Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Janitor01 authored Jul 18, 2024
2 parents b1a2da6 + e9959c7 commit 18ab175
Show file tree
Hide file tree
Showing 4 changed files with 2,796 additions and 48 deletions.
49 changes: 1 addition & 48 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ jobs:
else
echo "Unhandled event type: ${{ github.event_name }}"
fi
- name: Debug Information
run: |
echo "Test var: ${{ secrets.TEST }}"
validate_and_notify:
runs-on: ubuntu-latest
name: Validate JSON and Notify on Telegram
name: Validate JSON

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -65,47 +62,3 @@ jobs:
uses: GrantBirki/json-yaml-validate@v2.7.1
with:
comment: "true" # This will post a comment if the validation fails

- name: Prepare Notification Message
if: success() # This will proceed only if the previous validation step was successful
run: |
message=""
pr_link="${{ github.event.pull_request.html_url }}"
if [ "${{ github.event_name }}" == "pull_request" ]; then
if [ "${{ github.event.action }}" == "opened" ]; then
message="🚀 New PR created: #${{ github.event.pull_request.number }} by ${{ github.event.pull_request.user.login }} - $pr_link"
elif [ "${{ github.event.action }}" == "ready_for_review" ]; then
message="📝 PR is ready for review: #${{ github.event.pull_request.number }} - $pr_link"
elif [ "${{ github.event.action }}" == "reopened" ]; then
message="🔄 PR reopened: #${{ github.event.pull_request.number }} - $pr_link"
elif [ "${{ github.event.action }}" == "closed" ] && [ "${{ github.event.pull_request.merged }}" == "true" ]; then
message="✅ PR merged: #${{ github.event.pull_request.number }} - $pr_link"
elif [ "${{ github.event.action }}" == "closed" ] && [ "${{ github.event.pull_request.merged }}" == "false" ]; then
message="❌ PR closed without merging: #${{ github.event.pull_request.number }} - $pr_link"
fi
elif [ "${{ github.event_name }}" == "pull_request_review" ] && [ "${{ github.event.review.state }}" == "approved" ]; then
message="👍 PR approved by ${{ github.event.review.user.login }}: #${{ github.event.pull_request.number }} - $pr_link"
fi
if [ -z "$message" ]; then
echo "No relevant action taken, skipping notification."
exit 0
fi
echo "TG_SENDER_PAYLOAD_MESSAGE=$message" >> $GITHUB_ENV
- name: Send Notification to Telegram
if: env.TG_SENDER_PAYLOAD_MESSAGE != '' && success()
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.BOTTOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.CHATID }}
run: |
curl -X POST \
-H "Content-Type: application/json" \
-d "{\"chat_id\": \"$TELEGRAM_CHAT_ID\", \"text\": \"${{ env.TG_SENDER_PAYLOAD_MESSAGE }}\"}" \
"https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage"
# if: env.TG_SENDER_PAYLOAD_MESSAGE != '' && success()
# run: |
# curl -X POST \
# -H "Content-Type: application/json" \
# -d '{"chat_id": "${{ secrets.CHATID }}", "text": "${{ env.TG_SENDER_PAYLOAD_MESSAGE }}"}' \
# "https://api.telegram.org/bot${{ secrets.BotToken }}/sendMessage"
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "Mr Hankey",
"symbol": "SHIT",
"type": "PSP22",
"contractAddress": "5F9aiiwLMPC6fFxxwqHvJpm7h5T4Xm93mJT6cpDrQnKkLFoK",
"decimals": 12,
"description": "Most famous meme $SHIT",
"website": "https://the-shit.xyz/",
"sourceCode": "https://github.com/InkWhale-net/contracts/blob/feature/upgrade-op-4/op4_contracts/contracts/psp22_standard/psp22_standard.json",
"links": [
{
"name": "X/Twitter",
"url": "https://x.com/mr_hankey_shit"
},
{
"name": "Telegram",
"url": "https://t.me/mr_hankey_shit"
},
{
"name": "Discord",
"url": ""
}
],
"customTags": ["$SHIT Contract Address"],
"warnings": [],
"owner": "5DMCcKK5HuEtSQ9QT9eunuzLy7owhLGX5g77Es9fsoRyhcXj",
"minter": "5DMCcKK5HuEtSQ9QT9eunuzLy7owhLGX5g77Es9fsoRyhcXj"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 18ab175

Please sign in to comment.