Skip to content

Test pull request

Test pull request #105

name: Pull request approve workflow

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

View workflow run for this annotation

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

Invalid workflow file

(Line: 40, Col: 13): The identifier 'get_xetabase_branch' may not be used more than once within the same scope.
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
jobs:
calculate-xetabase-branch:
name: Calculate Xetabase branch
runs-on: ${{ vars.UBUNTU_VERSION }}
outputs:
xetabase_branch: ${{ steps.get_xetabase_branch.outputs.xetabase_branch }}
steps:
- name: Clone java-common-libs
uses: actions/checkout@v4
with:
fetch-depth: '10'
## This is important to avoid the error in the next step: "fatal: repository 'https://github.com/zetta-genomics/opencga-enterprise.git/' not found"
persist-credentials: false
- id: get_xetabase_branch
name: "Get JCL current branch for Xetabase from target branch"
run: |
chmod +x ./.github/workflows/scripts/get-xetabase-branch.sh
echo "github.event.pull_request.base.ref: ${{ inputs.target_branch }}"
echo "github.event.pull_request.head.ref: ${{ inputs.head_ref }}"
echo "secrets.ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}"
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ inputs.target_branch }} ${{ inputs.head_ref }})
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
env:
ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}
- id: get_xetabase_branch
name: "Get CI-CORE current branch for Xetabase from target branch"
run: |
chmod +x ./.github/workflows/scripts/get_opencga_enterprise_branch.sh
echo "github.event.pull_request.base.ref: ${{ inputs.target_branch }}"
echo "github.event.pull_request.head.ref: ${{ inputs.head_ref }}"
echo "secrets.ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}"
xetabase_branch=$(./.github/workflows/scripts/get_opencga_enterprise_branch.sh "java-common-libs" ${{ inputs.target_branch }} ${{ inputs.head_ref }})
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
env:
ZETTA_REPO_ACCESS_TOKEN: ${{ secrets.ZETTA_REPO_ACCESS_TOKEN }}
test:
name: "Run all tests before merging"
needs: calculate-xetabase-branch
uses: ./.github/workflows/test-xetabase-workflow.yml
with:
branch: ${{ needs.calculate-xetabase-branch.outputs.xetabase_branch }}
task: ${{ inputs.head_ref }}
secrets: inherit