From decbd40335712add4bc7884411b2a4f990ae1614 Mon Sep 17 00:00:00 2001 From: Sandeep Digumarty Date: Mon, 27 May 2024 10:13:22 +0530 Subject: [PATCH] chore: checkout the pull request head commit instead of merge commit in GHAs (#141) --- .github/workflows/build-and-push-docker-image.yml | 1 + .github/workflows/build-pr-artifacts.yml | 1 + .github/workflows/commitlint.yml | 1 + .github/workflows/draft-new-release.yml | 1 + .github/workflows/prod-deploy.yml | 1 + .github/workflows/publish-new-release.yml | 1 + .github/workflows/tests-code-coverage.yml | 1 + 7 files changed, 7 insertions(+) diff --git a/.github/workflows/build-and-push-docker-image.yml b/.github/workflows/build-and-push-docker-image.yml index 68c7c0c..978ce07 100644 --- a/.github/workflows/build-and-push-docker-image.yml +++ b/.github/workflows/build-and-push-docker-image.yml @@ -20,6 +20,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.0 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 - name: Login to DockerHub diff --git a/.github/workflows/build-pr-artifacts.yml b/.github/workflows/build-pr-artifacts.yml index 8e8554e..0ed5fbe 100644 --- a/.github/workflows/build-pr-artifacts.yml +++ b/.github/workflows/build-pr-artifacts.yml @@ -17,6 +17,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.1 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 # Replace problematic characters in branch name (like '/') with safe characters (like '.') diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index a8ff39e..4f291da 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -9,6 +9,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.1 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Setup Node diff --git a/.github/workflows/draft-new-release.yml b/.github/workflows/draft-new-release.yml index f09d379..9a81347 100644 --- a/.github/workflows/draft-new-release.yml +++ b/.github/workflows/draft-new-release.yml @@ -13,6 +13,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.0 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Setup Node diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml index 708eb32..299dca2 100644 --- a/.github/workflows/prod-deploy.yml +++ b/.github/workflows/prod-deploy.yml @@ -22,6 +22,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.0 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 - name: Get image version diff --git a/.github/workflows/publish-new-release.yml b/.github/workflows/publish-new-release.yml index d52cb93..ed278a7 100644 --- a/.github/workflows/publish-new-release.yml +++ b/.github/workflows/publish-new-release.yml @@ -27,6 +27,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.0 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Setup Node diff --git a/.github/workflows/tests-code-coverage.yml b/.github/workflows/tests-code-coverage.yml index 69b2259..347594a 100644 --- a/.github/workflows/tests-code-coverage.yml +++ b/.github/workflows/tests-code-coverage.yml @@ -17,6 +17,7 @@ jobs: - name: Checkout uses: actions/checkout@v4.1.1 with: + ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 1 - name: Setup Node