Skip to content

Commit

Permalink
Use newly updated script (#9)
Browse files Browse the repository at this point in the history
* Use newly updated script

* Update readme

* Cleanup branch renaming
  • Loading branch information
DragosDumitrache committed Jan 17, 2024
1 parent d005e34 commit 303772c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test-and-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
if: github.event_name != 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Run tests
run: |
sudo apt-get install -y bats
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ configuration driven.
Inside your GHA pipeline, simply add the following step:

```yaml
- uses: DragosDumitrache/versioner@v2.3.0
- uses: DragosDumitrache/versioner/versioner@v2.4.1
```
Incrementing the `major` or `minor` versions is done simply through a bump in your project's
Expand Down
9 changes: 6 additions & 3 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ function _calculate_version {
function _extract_branch_name {
git_branch=$(git branch --show-current)
if [[ ! $git_branch ]]; then
git_branch=$(git name-rev --name-only $(git show -s --format=%H))
to_remove="remotes/origin/"
git_branch=${git_branch/$to_remove/""}
git_branch="$(git name-rev --name-only $(git show -s --format=%H))"
fi
git_branch=${git_branch/$to_remove/""}
to_remove="remotes/origin/"
git_branch=${git_branch/$to_remove/""}
to_remove="remotes/heads/"
git_branch=${git_branch////"-"}
echo $git_branch
}

Expand Down
2 changes: 1 addition & 1 deletion versioner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
- uses: actions/checkout@v4
with:
repository: DragosDumitrache/versioner
ref: pass-in-git-branch
ref: 2.3.0
path: tools
- name: Generate and tag a new version on a PR
id: semver
Expand Down

0 comments on commit 303772c

Please sign in to comment.