Skip to content

Commit

Permalink
ci: version magic
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Apr 14, 2024
1 parent 542e16e commit bff5c85
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version (tag)
id: vars
- name: Get version (tag)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo "oj_version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
- name: Set version (hash)
id: vars
run: echo "OJ_GITVER=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Get version (hash)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "oj_version=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
run: echo "OJ_GITVER=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV
- name: Set version
id: vars
run: echo "oj_version=${{ env.OJ_GITVER }}" >> $GITHUB_OUTPUT
- name: Check version
run: echo "oj_version = ${{ steps.vars.outputs.oj_version }}"
outputs:
Expand Down

0 comments on commit bff5c85

Please sign in to comment.