From 37a95567896a65873b45b94962b63c72c5eb4fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 10 Jul 2023 09:30:17 +0200 Subject: [PATCH] gha: ci: nightly: Use github.sha to get the last commit reference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As we need to pass down the commit sha to the jobs that will be triggered from the `schedule` event, we must be careful on what exactly we're using there. At first we were using ${{ github.ref }}, but this turns out to be the **branch name**, rather than the commit hash. In order to actually get the commit hash, Let's use ${{ github.sha }} instead, as described by https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows# Fixes: #7247 Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/ci-nightly.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-nightly.yaml b/.github/workflows/ci-nightly.yaml index 9e36b9233d..9948bc9103 100644 --- a/.github/workflows/ci-nightly.yaml +++ b/.github/workflows/ci-nightly.yaml @@ -7,7 +7,7 @@ jobs: kata-containers-ci-on-push: uses: ./.github/workflows/ci.yaml with: - commit-hash: ${{ github.ref }} - pr-number: ${{ github.ref }} - tag: ${{ github.ref }}-nightly + commit-hash: ${{ github.sha }} + pr-number: ${{ github.sha }} + tag: ${{ github.sha }}-nightly secrets: inherit