diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index d34f0b57348..6bdc09d091d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -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 @@ -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 + }) }