From 119af85325ebe170c287751f96b409c812afd08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Thu, 31 Mar 2022 17:14:28 +0800 Subject: [PATCH] Fix bug when pushing the build-image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Checkout 2 commits to avoid mismatch of image tag when pushing the build-image Signed-off-by: Wenkai Yin(尹文开) --- .github/workflows/push-builder.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push-builder.yml b/.github/workflows/push-builder.yml index ef257ae8c..513937a44 100644 --- a/.github/workflows/push-builder.yml +++ b/.github/workflows/push-builder.yml @@ -12,7 +12,16 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 + with: + # The default value is "1" which fetches only a single commit. If we merge PR without squash or rebase, + # there are at least two commits: the first one is the merge commit and the second one is the real commit + # contains the changes. + # As we use the Dockerfile's commit ID as the tag of the build-image, fetching only 1 commit causes the merge + # commit ID to be the tag. + # While when running make commands locally, as the local git repository usually contains all commits, the Dockerfile's + # commit ID is the second one. This is mismatch with the images in Dockerhub + fetch-depth: 2 - name: Build run: make build-image