diff --git a/.github/workflows/check_semver.yaml b/.github/workflows/check_semver.yaml index ccfd2b8..71de22c 100644 --- a/.github/workflows/check_semver.yaml +++ b/.github/workflows/check_semver.yaml @@ -15,7 +15,20 @@ jobs: with: fetch-depth: 0 + - name: Check if Source Branch is docs + id: check_docs_branch + run: | + pr_head_ref="${{ github.event.pull_request.head.ref }}" + if [[ "$pr_head_ref" == "docs" ]]; then + echo "This is a docs branch merge. Exiting without creating a tag." + echo "is_docs_branch=true" >> $GITHUB_ENV + exit 0 + else + echo "is_docs_branch=false" >> $GITHUB_ENV + fi + - name: Extract and Determine Version + if: env.is_docs_branch != 'true' id: extract_version run: | # Fetch the latest tags from the remote @@ -54,6 +67,7 @@ jobs: echo "Version determined: $clean_version" - name: Check if Version Already Exists in Tags + if: env.is_docs_branch != 'true' run: | version="${{ env.version }}" if git tag --list | grep -q "^$version$"; then @@ -64,6 +78,7 @@ jobs: fi - name: Check Version in CHANGELOG + if: env.is_docs_branch != 'true' id: check_version run: | version="${{ env.version }}" @@ -72,4 +87,4 @@ jobs: exit 1 else echo "Version $version found in CHANGELOG.md." - fi + fi \ No newline at end of file diff --git a/.github/workflows/semver.yml b/.github/workflows/semver.yml index a4f97d3..88565c3 100644 --- a/.github/workflows/semver.yml +++ b/.github/workflows/semver.yml @@ -16,7 +16,20 @@ jobs: with: fetch-depth: 0 + - name: Check if Source Branch is docs + id: check_docs_branch + run: | + pr_head_ref="${{ github.event.pull_request.head.ref }}" + if [[ "$pr_head_ref" == "docs" ]]; then + echo "is_docs_branch=true" >> $GITHUB_ENV + echo "This is a docs branch merge. Exiting without creating a tag." + exit 0 + else + echo "is_docs_branch=false" >> $GITHUB_ENV + fi + - name: Bump Version and Tag + if: env.is_docs_branch != 'true' id: bump_version env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} @@ -67,6 +80,7 @@ jobs: git push origin $new_tag - name: Extract Release Notes + if: env.is_docs_branch != 'true' id: extract_notes run: | version="${{ env.new_tag }}" @@ -85,6 +99,7 @@ jobs: echo "EOF" >> $GITHUB_ENV - name: Create Release + if: env.is_docs_branch != 'true' uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} @@ -94,4 +109,3 @@ jobs: body: ${{ env.RELEASE_NOTES }} draft: false prerelease: false - \ No newline at end of file