diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71a16327f1..91ff209e84 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,6 +76,8 @@ jobs: ARTIFACTORY_USERNAME: ${{secrets.ARTIFACTORY_USERNAME}} ARTIFACTORY_PASSWORD: ${{secrets.ARTIFACTORY_PASSWORD}} SBT_OPTS: -Xmx3g + # https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} steps: - uses: actions/checkout@v2 @@ -84,11 +86,6 @@ jobs: - name: coursier-cache-action uses: coursier/cache-action@v5 - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extractBranch - - name: Generate java client id: generateJavaClient run: bash scripts/gen_java_client.sh @@ -102,5 +99,5 @@ jobs: - name: Publish java client as snapshot for PRs working-directory: codegen_java id: publishJavaClientSnapshot - if: ${{steps.extractBranch.outputs.branch != 'develop'}} + if: ${{ $BRANCH_NAME != 'develop' }} run: sbt "+ publish" -Dproject.isSnapshot=true