Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Feb 4, 2025
1 parent 174a9ba commit 9d3d57e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/scripts/docs/preview-deploy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = async ({ github, context }) => {
const { VERCEL_TOKEN, VERCEL_TEAM_ID, GITHUB_SHA } = process.env;
const { VERCEL_TOKEN, VERCEL_TEAM_ID } = process.env;

if (!VERCEL_TOKEN || !VERCEL_TEAM_ID) {
throw new Error(
Expand All @@ -8,8 +8,7 @@ module.exports = async ({ github, context }) => {
);
}

console.log(context.payload.pull_request.head);
return;
const commitSHA = context.payload.pull_request.head.sha;

const existingComments = (
await github.rest.issues.listComments({
Expand Down Expand Up @@ -39,17 +38,17 @@ module.exports = async ({ github, context }) => {
ref: "docs-preview",
},
projectSettings: {
buildCommand: `EDGEDB_REPO_BRANCH=${GITHUB_HEAD_REF} yarn vercel-build`,
buildCommand: `EDGEDB_REPO_BRANCH=${commitSHA} yarn vercel-build`,
},
}
);

commentMessage += `\n🔄 Deploying docs preview for commit ${GITHUB_SHA.slice(
commentMessage += `\n🔄 Deploying docs preview for commit ${commitSHA.slice(
0,
8
)}:\n\n<https://${deployment.url}>`;
} catch (e) {
commentMessage += `\n❌ Failed to deploy docs preview for commit ${GITHUB_SHA.slice(
commentMessage += `\n❌ Failed to deploy docs preview for commit ${commitSHA.slice(
0,
8
)}:\n\n\`\`\`\n${e.message}\n\`\`\``;
Expand Down

0 comments on commit 9d3d57e

Please sign in to comment.