Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

First version of pull-request #TASK-8067 #4

First version of pull-request #TASK-8067

First version of pull-request #TASK-8067 #4

# .github/workflows/pull-request-approve.yml

Check failure on line 1 in .github/workflows/pull-request-approve.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pull-request-approve.yml

Invalid workflow file

reusable workflows should be referenced at the top-level `jobs.*.uses' key, not within steps
# 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 }}