From bb5e0ecd2792fa859ae7ab83751b5f8a9ab03639 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Fri, 13 Jun 2025 18:00:37 -0400 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d549555..52cc4c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,31 +12,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y jq zip - - - name: Create release ZIP - run: | - zip -r community_bridge.zip . -x ".git/*" ".github/*" - - - name: Upload ZIP to release - uses: softprops/action-gh-release@v1 - with: - files: community_bridge.zip - env: - GITHUB_TOKEN: ${{ secrets.GH_PAT }} # Use PAT instead of default GitHub token + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq - name: Send webhook notification env: WEBHOOK_URL: ${{ secrets.RELEASE_WEBHOOK_URL }} run: | + # Extract repository name and release details REPO_NAME=$(basename "$GITHUB_REPOSITORY") RELEASE_VERSION=$(jq -r '.release.tag_name // "Unknown Version"' "$GITHUB_EVENT_PATH") TITLE="$REPO_NAME $RELEASE_VERSION" DESCRIPTION=$(jq -r '.release.body // "No description provided."' "$GITHUB_EVENT_PATH") + # Construct JSON payload PAYLOAD=$(jq -n \ --arg title "$TITLE" \ --arg description "$DESCRIPTION" \ @@ -68,15 +57,17 @@ jobs: "type": 2, "style": 5, "label": "Get The Latest Community Bridge Release", - "url": "https://github.com/The-Order-Of-The-Sacred-Framework/community_bridge/releases/latest" + "url": "https://github.com/The-Order-Of-The-Sacred-Framework/community_bridge/tree/main" } ] } ] }') + # Debugging: Print the payload for verification echo "$PAYLOAD" + # Send webhook curl -X POST "$WEBHOOK_URL" \ -H "Content-Type: application/json" \ --data-raw "$PAYLOAD" || exit 1