Skip to content

Commit fbf27b4

Browse files
committed
chore: fix typos
* chore: update pr preview workflow
1 parent 3deb38b commit fbf27b4

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

.github/workflows/pr-preview-build.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,48 @@ jobs:
9696
vercel-args: "--prebuilt"
9797

9898
wait-and-comment:
99-
needs: deploy-to-vercel
99+
needs: preview-sync
100100
runs-on: ubuntu-latest
101101

102102
steps:
103-
- name: Post "Building..." Comment Immediately
103+
- name: Install Vercel CLI
104+
run: npm install -g vercel
105+
106+
- name: Post "Building..." Sticky Comment
104107
uses: marocchino/sticky-pull-request-comment@v2
105108
with:
106109
number: ${{ github.event.pull_request.number }}
107110
header: VercelPreview
108111
message: |
109112
🟡 **Vercel preview is building...**
110113
114+
- name: Clone marketing-site preview branch
115+
env:
116+
TOKEN: ${{ secrets.SERVICE_BOT_TOKEN }}
117+
run: |
118+
git clone https://x-access-token:${TOKEN}@github.com/${{ secrets.SYNC_REPO }}.git private-repo
119+
cd private-repo
120+
git checkout $BRANCH_NAME
121+
122+
- name: Deploy to Vercel via CLI
123+
id: deploy
124+
working-directory: private-repo
125+
env:
126+
VERCEL_TOKEN: ${{ secrets.SERVICE_BOT_VERCEL }}
127+
run: |
128+
DEPLOY_OUTPUT=$(vercel --prebuilt --yes --token $VERCEL_TOKEN --scope ${{ secrets.VERCEL_TEAM_ID }} --confirm)
129+
echo "$DEPLOY_OUTPUT"
130+
DEPLOYMENT_URL=$(echo "$DEPLOY_OUTPUT" | grep -o 'https://[^ ]*\.vercel\.app' | tail -n1)
131+
DEPLOYMENT_ID=$(echo "$DEPLOY_OUTPUT" | grep -o 'deploymentId":"[^"]*' | cut -d'"' -f3)
132+
echo "deployment-url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT
133+
echo "deployment-id=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT
134+
111135
- name: Wait for Vercel Deployment
112136
id: wait
113137
uses: vercel/wait-for-deployment@v1
114138
with:
115139
token: ${{ secrets.SERVICE_BOT_VERCEL }}
116-
deployment-id: ${{ needs.deploy-to-vercel.outputs.deployment-id }}
140+
deployment-id: ${{ steps.deploy.outputs.deployment-id }}
117141
timeout: 900
118142

119143
- name: Update Sticky Comment with Success
@@ -124,7 +148,7 @@ jobs:
124148
header: VercelPreview
125149
message: |
126150
✅ **Vercel preview is ready!**
127-
🔗 [View deployment](${{ steps.wait.outputs.deployment-url }})
151+
🔗 [View deployment](${{ steps.deploy.outputs.deployment-url }})
128152
129153
- name: Update Sticky Comment with Failure
130154
if: ${{ steps.wait.outputs.ready-state != 'READY' }}

guides/hooks/posthog-telemetry-hook.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can inject custom actions at the following points in the SDK's execution:
3232

3333
## Adding the Posthog SDK to your project
3434

35-
To add the Posthog SDK to your project, you will need to add the dependancy to your Speakeasy SDK's `gen.yaml` file under the dependancies section:
35+
To add the Posthog SDK to your project, you will need to add the dependency to your Speakeasy SDK's `gen.yaml` file under the dependancies section:
3636

3737
```yaml
3838
configVersion: 2.0.0
@@ -46,7 +46,7 @@ typescript:
4646
posthog-node: ^4.0.1 <- This is the line you need to add, ensure the version you add adheres to NPM package standards.
4747
```
4848
49-
After adding the dependency, the Posthog SDK will be included in your projects package.json file everytime you generate your SDK.
49+
After adding the dependency, the Posthog SDK will be included in your projects package.json file every time you generate your SDK.
5050
5151
## Adding your first SDK hook
5252

0 commit comments

Comments
 (0)