Skip to content

Commit

Permalink
Get doc version name
Browse files Browse the repository at this point in the history
  • Loading branch information
nhuet committed Oct 14, 2022
1 parent e10ff65 commit 701ff14
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 701ff14

Please sign in to comment.