From 14152b0a09b306fc3fa63e74514cdfd54f0b5559 Mon Sep 17 00:00:00 2001 From: Yi Chen Date: Mon, 22 Jul 2024 13:51:40 +0800 Subject: [PATCH] Update integration test workflow Signed-off-by: Yi Chen --- .github/workflows/integration.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index fffae04e8..be5200f9e 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -93,6 +93,18 @@ jobs: build-helm-chart: runs-on: ubuntu-20.04 steps: + - name: Determine branch name + id: get_branch + run: | + BRANCH="" + if [ "${{ github.event_name }}" == "push" ]; then + BRANCH=${{ github.ref }} + elif [ "${{ github.event_name }}" == "pull_request" ]; then + BRANCH=${{ github.base_ref }} + fi + echo "Branch name: $BRANCH" + echo "BRANCH=$BRANCH" >> "$GITHUB_OUTPUT" + - name: Checkout source code uses: actions/checkout@v4 with: @@ -122,8 +134,10 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed + env: + BRANCH: ${{ steps.get_branch.outputs.BRANCH }} run: | - changed=$(ct list-changed --target-branch ${{ github.ref }}) + changed=$(ct list-changed --target-branch $BRANCH) if [[ -n "$changed" ]]; then echo "changed=true" >> "$GITHUB_OUTPUT" fi