fix: auto-publish new active products to storefront #64
This file contains hidden or 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
| # Sync GitHub Issues and PRs to Lovable (main project) | ||
|
Check failure on line 1 in .github/workflows/sync-issues-prs-to-lovable.yml
|
||
| # Repo: asperpharma/understand-project | ||
| # Lovable: https://lovable.dev/projects/657fb572-13a5-4a3e-bac9-184d39fdf7e6 | ||
| # | ||
| # Sends issue/PR open, edit, reopen, close events to Lovable via webhook. | ||
| # SETUP: In GitHub repo → Settings → Secrets and variables → Actions, add: | ||
| # LOVABLE_WEBHOOK_URL = (webhook URL from Lovable, if provided) | ||
| # | ||
| name: Sync Issues and PRs to Lovable | ||
| on: | ||
| issues: | ||
| types: [opened, edited, closed, reopened] | ||
| pull_request: | ||
| types: [opened, edited, reopened, closed] | ||
| jobs: | ||
| sync_to_lovable: | ||
| runs-on: ubuntu-latest | ||
| if: secrets.LOVABLE_WEBHOOK_URL != '' | ||
| steps: | ||
| - name: Send event data to Lovable | ||
| env: | ||
| LOVABLE_WEBHOOK_URL: ${{ secrets.LOVABLE_WEBHOOK_URL }} | ||
| run: | | ||
| echo "Sending event to Lovable..." | ||
| PAYLOAD=$(jq -n \ | ||
| --arg event_name "${{ github.event_name }}" \ | ||
| --arg action "${{ github.event.action }}" \ | ||
| --arg repo "${{ github.repository }}" \ | ||
| --arg sender "${{ github.actor }}" \ | ||
| --arg url "${{ github.event.issue.html_url || github.event.pull_request.html_url }}" \ | ||
| --arg title "${{ github.event.issue.title || github.event.pull_request.title }}" \ | ||
| --arg body "${{ github.event.issue.body || github.event.pull_request.body }}" \ | ||
| '{event_name: $event_name, action: $action, repo: $repo, sender: $sender, url: $url, title: $title, body: $body}' | ||
| ) | ||
| curl -s -X POST "$LOVABLE_WEBHOOK_URL" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$PAYLOAD" | ||
| echo "Done." | ||