Skip to content

Commit

Permalink
increment commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanformio committed Mar 19, 2024
1 parent 25514bf commit 502bfc7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ jobs:
run: |
PR_NUMBER=$(echo ${{ github.event.number }})
CURRENT_VERSION=$(node -p "require('./package.json').version")
NEW_VERSION="${CURRENT_VERSION}-dev.${PR_NUMBER}.0"
# Fetch all history for all tags and branches to ensure we're counting accurately
git fetch --prune --unshallow
# Count the number of commits on the current branch and subtract 1 to start the index at 0
COMMIT_COUNT=$(($(git rev-list --count HEAD) - 1))
NEW_VERSION="${CURRENT_VERSION}-dev.${PR_NUMBER}.${COMMIT_COUNT}"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Echo version for testing
Expand Down

0 comments on commit 502bfc7

Please sign in to comment.