Skip to content

Commit

Permalink
get commit sha
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanformio committed Mar 19, 2024
1 parent 9739d33 commit 45ba41f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,21 @@ jobs:
# Use git log to count commits if git rev-list does not work as expected
SHORT_SHA=${GITHUB_SHA::7}
COMMIT_COUNT=$(($(git log master..HEAD --oneline | wc -l) - 1))
COMMIT_COUNT=$(git log master..HEAD --oneline | wc -l)
NEW_VERSION="${CURRENT_VERSION}-dev.${PR_NUMBER}.${COMMIT_COUNT}"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
else
echo "Failed to fetch master branch."
# Handle error or fallback scenario
fi
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}

- name: Echo version for testing
run: |
echo "Commit SHA: $SHORT_SHA"
echo "Version to publish: $NEW_VERSION"

0 comments on commit 45ba41f

Please sign in to comment.