Skip to content

Commit

Permalink
Use pull request head
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Oct 23, 2021
1 parent cc30a38 commit dcc6653
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/deploy-preview.yml
@@ -1,7 +1,7 @@
name: Deploy Preview

on:
pull_request_target:
pull_request:
branches:
- main

Expand All @@ -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
Expand All @@ -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}}

0 comments on commit dcc6653

Please sign in to comment.