This repository was archived by the owner on Mar 12, 2026. It is now read-only.
First version of pull-request #TASK-8067 #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/pull-request-approve.yml | ||
| # Workflow to be triggered on PR approval, receives target_branch as input, checks out the repo, | ||
| # computes the correct opencga-enterprise branch, and calls test-xetabase with the calculated branch and PR head as task. | ||
| name: Xetabase PR Approve Entrypoint | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| target_branch: | ||
| description: 'Target branch of the PR (github.event.pull_request.base.ref)' | ||
| required: true | ||
| type: string | ||
| head_ref: | ||
| description: 'Source branch of the PR (github.event.pull_request.head.ref)' | ||
| required: true | ||
| type: string | ||
| secrets: | ||
| ZETTA_REPO_ACCESS_TOKEN: | ||
| required: true | ||
| THIRDPARTY_READ_TOKEN: | ||
| required: false | ||
| KEEPER_SM_GH_OPENCB: | ||
| required: false | ||
| jobs: | ||
| resolve-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout triggering repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 10 | ||
| path: triggering-repo | ||
| - name: Parse pom.xml to get project artifactId | ||
| id: pom | ||
| shell: bash | ||
| working-directory: triggering-repo | ||
| run: | | ||
| artifactId=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.artifactId}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec) | ||
| echo "artifactId=$artifactId" >> "$GITHUB_OUTPUT" | ||
| - name: Checkout ci-core (scripts) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: opencb/ci-core | ||
| path: ci-core | ||
| - name: Compute opencga-enterprise branch | ||
| id: compute_branch | ||
| env: | ||
| ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }} | ||
| shell: bash | ||
| working-directory: triggering-repo | ||
| run: | | ||
| pwd | ||
| ls -la | ||
| ls -la ../ | ||
| chmod +x ../ci-core/.github/workflows/scripts/get_opencga_enterprise_branch.sh | ||
| branch=$( ../ci-core/.github/workflows/scripts/get_opencga_enterprise_branch.sh "${{ steps.pom.outputs.artifactId }}" "${{ inputs.target_branch }}" "${{ inputs.head_ref }}" ) | ||
| echo "branch=$branch" | tee -a $GITHUB_STEP_SUMMARY | ||
| echo "branch=$branch" >> $GITHUB_OUTPUT | ||
| - name: Checkout opencga-enterprise | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: zetta-genomics/opencga-enterprise | ||
| ref: ${{ steps.compute_branch.outputs.branch }} | ||
| path: opencga-enterprise | ||
| token: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }} | ||
| - name: Call test-xetabase workflow with calculated branch | ||
| uses: opencb/ci-core/.github/workflows/test-xetabase.yml@main | ||
| with: | ||
| branch: ${{ steps.compute_branch.outputs.branch }} | ||
| task: ${{ inputs.head_ref }} | ||