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:
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