From 701ff1413d17ff384d9693d7990bcdae7432b695 Mon Sep 17 00:00:00 2001 From: Nolwen Date: Fri, 14 Oct 2022 16:02:29 +0200 Subject: [PATCH] Get doc version name --- .github/workflows/build.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcbc648..b4ee0f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,14 +15,24 @@ concurrency: cancel-in-progress: true jobs: - hob_always_skppped: + job_for_tags_and_default: runs-on: ubuntu-latest - if: false + if: startsWith(github.ref, 'refs/tags/v') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) steps: - - run: echo should not run + - name: Get doc version name + run: | + if [ ${GITHUB_REF} = refs/heads/${{ github.event.repository.default_branch }} ]; then + VERSION=${{ github.event.repository.default_branch }} + else + VERSION=${GITHUB_REF/refs\/tags\/v/} # stripping "refs/tags/v" + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: test it + run: echo $VERSION + + job_depending_on_skipped_test: runs-on: ubuntu-latest - needs: hob_always_skppped steps: - run: echo should not run