added check for docs

This commit is contained in:
Schmieder, Jacob
2024-05-31 12:30:10 +00:00
parent 5ebfb647f2
commit 72f57d5a7f
2 changed files with 31 additions and 2 deletions
+16 -1
View File
@@ -15,7 +15,20 @@ jobs:
with: with:
fetch-depth: 0 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 - name: Extract and Determine Version
if: env.is_docs_branch != 'true'
id: extract_version id: extract_version
run: | run: |
# Fetch the latest tags from the remote # Fetch the latest tags from the remote
@@ -54,6 +67,7 @@ jobs:
echo "Version determined: $clean_version" echo "Version determined: $clean_version"
- name: Check if Version Already Exists in Tags - name: Check if Version Already Exists in Tags
if: env.is_docs_branch != 'true'
run: | run: |
version="${{ env.version }}" version="${{ env.version }}"
if git tag --list | grep -q "^$version$"; then if git tag --list | grep -q "^$version$"; then
@@ -64,6 +78,7 @@ jobs:
fi fi
- name: Check Version in CHANGELOG - name: Check Version in CHANGELOG
if: env.is_docs_branch != 'true'
id: check_version id: check_version
run: | run: |
version="${{ env.version }}" version="${{ env.version }}"
@@ -72,4 +87,4 @@ jobs:
exit 1 exit 1
else else
echo "Version $version found in CHANGELOG.md." echo "Version $version found in CHANGELOG.md."
fi fi
+15 -1
View File
@@ -16,7 +16,20 @@ jobs:
with: with:
fetch-depth: 0 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 - name: Bump Version and Tag
if: env.is_docs_branch != 'true'
id: bump_version id: bump_version
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
@@ -67,6 +80,7 @@ jobs:
git push origin $new_tag git push origin $new_tag
- name: Extract Release Notes - name: Extract Release Notes
if: env.is_docs_branch != 'true'
id: extract_notes id: extract_notes
run: | run: |
version="${{ env.new_tag }}" version="${{ env.new_tag }}"
@@ -85,6 +99,7 @@ jobs:
echo "EOF" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV
- name: Create Release - name: Create Release
if: env.is_docs_branch != 'true'
uses: actions/create-release@v1 uses: actions/create-release@v1
env: env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
@@ -94,4 +109,3 @@ jobs:
body: ${{ env.RELEASE_NOTES }} body: ${{ env.RELEASE_NOTES }}
draft: false draft: false
prerelease: false prerelease: false