handle IPFS upload, download. Implements badge creation and rewarding. #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notify Discord on Commit | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
notify-discord: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send Discord Notification | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
REPO_URL: https://github.com/${{ github.repository }} | |
run: | | |
# Extract commit details using jq | |
COMMIT_MESSAGE=$(echo '${{ toJson(github.event) }}' | jq -r '.head_commit.message') | |
COMMIT_AUTHOR=$(echo '${{ toJson(github.event) }}' | jq -r '.head_commit.author.username') | |
COMMIT_URL="$REPO_URL/commit/${{ github.sha }}" | |
# Send the message to Discord | |
curl -X POST \ | |
-H "Content-Type: application/json" \ | |
-d "{\"content\": \"🚀 A new update has been pushed to our platform! **${{ github.repository }}**\\n\\n**Commit Message**: $COMMIT_MESSAGE\\n**Author**: $COMMIT_AUTHOR\\n[View Commit]($COMMIT_URL)\"}" \ | |
$DISCORD_WEBHOOK_URL |