diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index a4e89a4..13e0ab4 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -2,7 +2,7 @@ name: Semver Workflow on: pull_request: - types: [opened, synchronize, closed] + types: [closed] branches: [main, qa, staging] permissions: @@ -49,9 +49,9 @@ jobs: last_version=$(git tag --sort=-version:refname | grep -P "^$package_name@v\d+.\d+.\d+$" | head -n 1 | cut -d v -f 2) if [ -z "$last_version" ]; then new_version=1.0.0 - elif [[ ${{ github.head_ref }} =~ ^"major" ]]; then + elif [[ "${{ github.event.pull_request.title }}" =~ ^"major" ]]; then new_version=$(semver bump major "$last_version") - elif [[ ${{ github.head_ref }} =~ ^"feat" ]]; then + elif [[ "${{ github.event.pull_request.title }}" =~ ^"feat" ]]; then new_version=$(semver bump minor "$last_version") else new_version=$(semver bump patch "$last_version") @@ -69,7 +69,7 @@ jobs: - name: Push Tag if: github.event.pull_request.merged id: tag_version - uses: mathieudutour/github-tag-action@v5.6 + uses: mathieudutour/github-tag-action@v6.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ env.tag_version }} @@ -82,3 +82,4 @@ jobs: prerelease: false title: ${{ env.tag_version }} automatic_release_tag: ${{ env.tag_version }} + \ No newline at end of file diff --git a/test.html b/test.html index 73fdbc4..60da87e 100644 --- a/test.html +++ b/test.html @@ -5,6 +5,6 @@ Title - Initial version + third version of the file A new feature \ No newline at end of file