From ec21b29c02e1f0a85d0dffd02af4e5f623557629 Mon Sep 17 00:00:00 2001 From: Alex Christy Date: Sun, 7 Jul 2024 20:22:08 -0400 Subject: [PATCH] Fix logic that extracts ref branch --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2208e8..bc51645 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: pull_request: branches: - main + push: + branches: + - main jobs: run-wazuh-tests: @@ -13,6 +16,11 @@ jobs: - name: Check out the repository uses: actions/checkout@v2 + - name: Extract branch name + id: extract_branch + shell: bash + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + - name: Log in to Docker Hub uses: docker/login-action@v2 with: @@ -24,7 +32,7 @@ jobs: - name: Run container with branch info run: | - docker run -e BRANCH_NAME=${GITHUB_REF_NAME} ${{ secrets.DOCKER_IMAGE }} || exit 1 + docker run -e BRANCH_NAME=${{ steps.extract_branch.outputs.branch }} ${{ secrets.DOCKER_IMAGE }} || exit 1 - name: Verify container exit status run: |