From 5ac9dbeb89da62d7f85187f6738dfaae64ea8382 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 22 Oct 2021 14:59:18 -1000 Subject: [PATCH] Use pull request head --- .github/workflows/deploy-preview.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index e465aed3cc2..4255f9d0f4f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -16,7 +16,7 @@ jobs: - run: npm install --global netlify-cli - uses: lewagon/wait-on-check-action@v1.1.1 with: - ref: ${{github.ref}} + ref: ${{github.head_ref}} check-name: 'build-preview' repo-token: ${{secrets.GITHUB_TOKEN}} wait-interval: 10 @@ -31,3 +31,19 @@ jobs: NETLIFY_AUTH_TOKEN: ${{secrets.NETLIFY_AUTH_TOKEN}} NETLIFY_SITE_ID: ${{secrets.NETLIFY_SITE_ID}} run: netlify deploy --dir=build/site --alias=deploy-preview-${{github.event.number}} + - uses: octokit/request-action@v2.x + id: create_check_run + with: + route: POST /repos/{owner}/{repo}/check-runs + owner: openlayers + repo: openlayers + name: preview-url + head_sha: ${{github.event.pull_request.head.sha}} + details_url: https://deploy-preview-${{github.event.number}}--ol-site.netlify.app + conclusion: "success" + status: "completed" + output: | + title: Preview URL + summary: URL of the preview deploy + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}