diff --git a/.github/workflows/veracode-build.yml b/.github/workflows/veracode-build.yml index cac0f125c7..e9cb6412fa 100644 --- a/.github/workflows/veracode-build.yml +++ b/.github/workflows/veracode-build.yml @@ -40,7 +40,7 @@ on: env: REFERENCE_BRANCH: maintenance-3.0.x NPM_REPOSITORY: https://packages.nuxeo.com/repository/npm-public/ - BRANCH_NAME: ${{ 'maintenance-3.0.x' }} + BRANCH_NAME: ${{ github.head_ref || inputs.branch || 'maintenance-3.0.x' }} # A workflow run is made up of one or more jobs that can run sequentially or in parallel permissions: @@ -73,6 +73,14 @@ jobs: distribution: 'zulu' java-version: '11' + - name: Determine nuxeo-elements branch to link + id: pick_nuxeo_elements_branch + run: | + if git ls-remote --exit-code --heads https://github.com/nuxeo/nuxeo-elements ${{ env.BRANCH_NAME }}; then + echo ::set-output name=branch::${{ env.BRANCH_NAME }} + else + echo ::set-output name=branch::${{ env.REFERENCE_BRANCH }} + fi - name: Install Web UI env: NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGES_TOKEN }} @@ -87,7 +95,7 @@ jobs: repository: nuxeo/nuxeo-elements path: nuxeo-elements fetch-depth: 1 - ref: ${{ env.BRANCH_NAME }} + ref: ${{ steps.pick_nuxeo_elements_branch.outputs.branch }} - name: Pack Elements modules run: |