Skip to content

Commit

Permalink
get last tag with gh
Browse files Browse the repository at this point in the history
  • Loading branch information
j-hc committed Sep 30, 2023
1 parent abe4f03 commit c078cf5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@ jobs:
fetch-depth: 0
submodules: true

- name: Get last tag
id: last_tag
uses: oprypin/find-latest-tag@v1
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
releases-only: true

- name: Get next version code
id: next_ver_code
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.last_tag.outputs.tag }}"
TAG=$(gh release list -L 1 | awk -F '\t' '{print $3}')
if [ -z "$TAG" ]; then TAG=0; fi
echo "NEXT_VER_CODE=$((TAG + 1))" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit c078cf5

Please sign in to comment.