Skip to content

Commit

Permalink
fix(deploy-preview): enable comments on prs from forks
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones authored Feb 21, 2025
1 parent de04c71 commit d487c3b
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
restore-keys: |
${{ runner.os }}-public-gatsby
- name: Build site
run: yarn build:clean
run: yarn build
env:
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true
NODE_ENV: production
Expand Down Expand Up @@ -90,22 +90,19 @@ jobs:
comment = comment + "failed to publish"
}
if (context.payload.pull_request.head.repo.full_name !== 'carbon-design-system/carbon-website') {
console.log('Not attempting to write comment on PR from fork');
// Create or update comment
if (deployPreviewComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: deployPreviewComment.id,
body: comment
})
} else {
if (deployPreviewComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: deployPreviewComment.id,
body: comment
})
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: comment
})
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: comment
})
}

0 comments on commit d487c3b

Please sign in to comment.