From 59b43bd5a25c9f0a76bca6d53c60d6c7f56ff09b Mon Sep 17 00:00:00 2001 From: M4K3R Date: Fri, 20 Nov 2026 13:51:39 +0800 Subject: [PATCH] ci: add Pinata pin-by-CID step after 4EVERLAND pin Pin the deployed CID to Pinata via the v3 pin_by_cid endpoint using the PINATA_JWT Actions secret. Fails the step on non-200 HTTP response. --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6a60bc..edc24ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,3 +248,28 @@ jobs: echo "⚠️ TIMEOUT: Pin did not reach 'pinned' status within 60 seconds" exit 1 + + - name: Pin to Pinata + env: + PINATA_JWT: ${{ secrets.PINATA_JWT }} + PINATA_CID: ${{ steps.deploy.outputs.cid }} + run: | + RESP=$(curl --silent --show-error --write-out '\n%{http_code}' \ + --request POST \ + --url https://api.pinata.cloud/v3/files/public/pin_by_cid \ + --header "authorization: Bearer ${PINATA_JWT}" \ + --header "content-type: application/json" \ + --data "{\"cid\": \"${PINATA_CID}\", \"name\": \"site\"}") + + HTTP_CODE=$(echo "$RESP" | tail -n1) + BODY=$(echo "$RESP" | sed '$d') + + echo "Pinata pin-by-CID response (HTTP $HTTP_CODE):" + echo "$BODY" + + if [ "$HTTP_CODE" != "200" ]; then + echo "❌ Pinata pin failed with HTTP $HTTP_CODE" + exit 1 + fi + + echo "✅ Pin accepted by Pinata (CID: ${PINATA_CID})"