Skip to content

Commit

Permalink
added line to remove the quote
Browse files Browse the repository at this point in the history
  • Loading branch information
ywkim312 committed Nov 5, 2024
1 parent def58c0 commit b7cdb43
Showing 1 changed file with 37 additions and 28 deletions.
65 changes: 37 additions & 28 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,43 @@ jobs:
- uses: actions/checkout@v2

# calculate some variables that are used later
- name: version information
run: |
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
BRANCH="${{ github.event.release.target_commitish }}"
elif [[ $GITHUB_REF =~ pull ]]; then
BRANCH="$(echo $GITHUB_REF | sed 's#refs/pull/\([0-9]*\)/merge#PR-\1#')"
else
BRANCH=${GITHUB_REF##*/}
fi
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
if [ "$BRANCH" == "test-main" ]; then
version=$(awk -F= '/^release/ { print $2}' docs/source/conf.py | sed "s/[ ']//g")
tags="latest"
oldversion=""
while [ "${oldversion}" != "${version}" ]; do
oldversion="${version}"
tags="${tags},${version}"
version=${version%.*}
done
echo "VERSION=${version}" >> $GITHUB_ENV
echo "TAGS=${tags}" >> $GITHUB_ENV
elif [ "$BRANCH" == "develop" ]; then
echo "VERSION=develop" >> $GITHUB_ENV
echo "TAGS=develop" >> $GITHUB_ENV
else
echo "VERSION=testing" >> $GITHUB_ENV
echo "TAGS=${BRANCH}" >> $GITHUB_ENV
fi
- name: version information
run: |
if [ "${{ github.event.release.target_commitish }}" != "" ]; then
BRANCH="${{ github.event.release.target_commitish }}"
elif [[ $GITHUB_REF =~ pull ]]; then
BRANCH="$(echo $GITHUB_REF | sed 's#refs/pull/\([0-9]*\)/merge#PR-\1#')"
else
BRANCH=${GITHUB_REF##*/}
fi
echo "GITHUB_BRANCH=${BRANCH}" >> $GITHUB_ENV
if [ "$BRANCH" == "test-main" ]; then
# Extract version from conf.py and generate tags without quotes
version=$(awk -F= '/^release/ { print $2}' docs/source/conf.py | sed "s/[ ']//g")
tags="latest"
oldversion=""
while [ "${oldversion}" != "${version}" ]; do
oldversion="${version}"
tags="${tags},${version}"
version=${version%.*}
done
# Remove any unwanted double quotes from tags
tags=$(echo $tags | sed 's/"//g')
echo "VERSION=${version}" >> $GITHUB_ENV
echo "TAGS=${tags}" >> $GITHUB_ENV
elif [ "$BRANCH" == "develop" ]; then
echo "VERSION=develop" >> $GITHUB_ENV
echo "TAGS=develop" >> $GITHUB_ENV
else
echo "VERSION=testing" >> $GITHUB_ENV
echo "TAGS=${BRANCH}" >> $GITHUB_ENV
fi
# debug TAGS
- name: Debug TAGS
Expand Down

0 comments on commit b7cdb43

Please sign in to comment.