diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 1f5708d2ad..29057de8de 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -15,6 +15,31 @@ permissions: contents: read # to fetch code (actions/checkout) jobs: + prepare: + name: Prepare version strings + if: github.repository == 'openra/openra' + runs-on: ubuntu-22.04 + steps: + - name: Prepare environment variables + run: | + if [ "${{ github.event_name }}" = "push" ]; then + if [ "${{ github.ref_type }}" = "tag" ]; then + VERSION_TYPE=`echo "${GITHUB_REF#refs/tags/}" | cut -d"-" -f1` + echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "VERSION_TYPE=$VERSION_TYPE" >> $GITHUB_ENV + else + echo "GIT_TAG=bleed" >> $GITHUB_ENV + echo "VERSION_TYPE=bleed" >> $GITHUB_ENV + fi + else + VERSION_TYPE=`echo "${{ github.event.inputs.tag }}" | cut -d"-" -f1` + echo "GIT_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV + echo "VERSION_TYPE=$VERSION_TYPE" >> $GITHUB_ENV + fi + outputs: + git_tag: ${{ env.GIT_TAG }} + version_type: ${{ env.VERSION_TYPE }} + wiki: name: Update Wiki if: github.repository == 'openra/openra'