From cae5ef159238abd2ef0b43541a5b7673cb778e4a Mon Sep 17 00:00:00 2001 From: Pranav Gaikwad Date: Tue, 16 Apr 2024 09:11:02 -0400 Subject: [PATCH] :ghost: use correct branch in workflow Signed-off-by: Pranav Gaikwad --- .github/workflows/testing.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 526057f..3fc7a63 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -6,6 +6,33 @@ jobs: test: runs-on: ubuntu-latest steps: + - name: Extract pull request number from inputs or PR description + run: | + PULL_REQUEST_NUMBER=$(echo "${{ github.event.pull_request.body }}" | grep -oP 'Analyzer PR: \K\d+' || true) + echo "ANALYZER_REF=${CURRENT_BRANCH#refs/heads/}" >>$GITHUB_ENV + if [ ! -z "${BASE_BRANCH}" ]; then + echo "ANALYZER_REF=${BASE_BRANCH}" >>$GITHUB_ENV + fi + if [ ! -z "$PULL_REQUEST_NUMBER" ]; then + echo "ANALYZER_REF=refs/pull/$PULL_REQUEST_NUMBER/merge" >>$GITHUB_ENV + fi + echo "Using analyzer branch ${env.ANALYZER_REF}" + env: + CURRENT_BRANCH: ${{ github.ref }} + BASE_BRANCH: ${{ github.event.pull_request.base.ref }} + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: konveyor/analyzer-lsp + ref: "${{ env.ANALYZER_REF}}" + path: analyzer-lsp + + - name: Build anaylzer and save image + working-directory: analyzer-lsp + run: | + podman build -t quay.io/konveyor/analyzer-lsp:latest . + - uses: actions/checkout@v3 - name: Build image and binary