Skip to content

Commit

Permalink
echo branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanformio committed Mar 19, 2024
1 parent 6ca8452 commit 8cb383c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/repo.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Test
name: Build / Test / Publish

on:
# push:
Expand Down Expand Up @@ -112,15 +112,21 @@ jobs:
echo "Master branch fetched successfully."
# Use git log to count commits if git rev-list does not work as expected
COMMIT_COUNT=$(git log origin/master..HEAD --oneline | wc -l)
COMMIT_COUNT=$($(git log origin/master..HEAD --oneline | wc -l) - 1)
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: Echo version and branch for testing
run: |
echo "Version to publish: $NEW_VERSION"
# Extract the branch name from the GitHub event payload
BRANCH_NAME=$(jq --raw-output .pull_request.head.ref $GITHUB_EVENT_PATH)
- name: Echo version for testing
run: |
echo "Current branch: $BRANCH_NAME"
echo "Version to publish: $NEW_VERSION"

0 comments on commit 8cb383c

Please sign in to comment.