Skip to content

fix: auto-publish new active products to storefront #64

fix: auto-publish new active products to storefront

fix: auto-publish new active products to storefront #64

# Sync GitHub Issues and PRs to Lovable (main project)

Check failure on line 1 in .github/workflows/sync-issues-prs-to-lovable.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/sync-issues-prs-to-lovable.yml

Invalid workflow file

(Line: 20, Col: 9): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.LOVABLE_WEBHOOK_URL != ''
# 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."