Skip to content

Commit

Permalink
use PR Head checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
Joost van der Griendt committed Mar 28, 2021
1 parent 58b77ce commit e35fe90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pull-request-preview-build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: "Pull Request Preview Build"
on: pull_request
on:
pull_request:
branches: [main]

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set env
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA)" >> $GITHUB_ENV
- name: Test
Expand All @@ -27,6 +31,6 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: caladreas/cmg:latest,caladreas/cmg:${{ env.GITHUB_SHA_SHORT }}
tags: caladreas/cmg:${{ env.GITHUB_SHA_SHORT }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit e35fe90

Please sign in to comment.