Skip to content

Commit

Permalink
Merge branch 'test-main' into 181-update-github-action-version
Browse files Browse the repository at this point in the history
  • Loading branch information
ywkim312 authored Nov 5, 2024
2 parents b7cdb43 + c2a71de commit a39ebe8
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,46 @@ 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
# 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
- 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
run: echo "TAGS=${{ env.TAGS }}"

# debug TAGS
- name: Debug TAGS
Expand Down

0 comments on commit a39ebe8

Please sign in to comment.