From a442e2c6ff747a5eaa519ef9c40fa7ea2f133bc2 Mon Sep 17 00:00:00 2001 From: Nate Shoemaker Date: Thu, 7 Nov 2024 16:21:21 -0800 Subject: [PATCH] Force actions/checkout to use pull request HEAD sha (experiment) --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 706e76d7a..51839bac8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: - main tags: - - 'v*' + - "v*" workflow_dispatch: pull_request: @@ -26,7 +26,7 @@ jobs: services: db: image: postgres:15 - ports: ['5432:5432'] + ports: ["5432:5432"] env: POSTGRES_PASSWORD: postgres options: >- @@ -110,6 +110,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: Log in to the Container registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 @@ -132,7 +134,7 @@ jobs: type=raw,enable={{is_default_branch}},value=latest # tag event (eg. "v1.2.3") type=ref,event=tag - + - name: Check if PR publish if: ${{ github.event_name == 'pull_request' }} id: pr_publish_check