Repository navigation
38 lines (34 loc) · 1.58 KB
/
Copy pathstaging-preview-note.yml
File metadata and controls
38 lines (34 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Staging preview note
# Staging runs main's backend (docs/staging.md). A PR that opens with
# changes to supabase/ gets a comment saying its staging preview still uses
# main's migrations and Edge Functions until it merges.
on:
pull_request:
# The note posts once, so later pushes have nothing to add.
types: [opened, reopened]
paths:
- "supabase/migrations/**"
- "supabase/functions/**"
permissions:
pull-requests: write
jobs:
note:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Comment once
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
shell: bash
run: |
marker="<!-- staging-preview-note -->"
# Read every comment first: grep -q exiting early would SIGPIPE gh, and
# under pipefail that reads as "no marker" and posts a duplicate.
bodies="$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR}/comments" --paginate --jq '.[].body')"
if grep -qF "$marker" <<< "$bodies"; then
exit 0
fi
gh pr comment "$PR" --repo "$GITHUB_REPOSITORY" --body "$marker
This PR changes \`supabase/\`. Its **debatelab-staging** preview talks to staging, which runs main's migrations and Edge Functions, so this PR's backend changes are not there yet. The VPS staging sync applies them within about 5 minutes of the merge. To try them before merging, use the \`verify-debatelab\` skill against a local stack. See docs/staging.md."