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