Skip to content

Commit

Permalink
use tee with $GITHUB_ENV
Browse files Browse the repository at this point in the history
this also printsw the value to the console, making it easieer to debug
  • Loading branch information
Cube707 committed Mar 9, 2023
1 parent 0cc5ad2 commit f370fea
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
fetch-depth: 0
- name: Set env
run: |
echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" | tee $GITHUB_ENV
echo "BRANCH=$( \
git branch -r --contains ${GITHUB_REF} \
| grep -v HEAD \
| sed -n 's/ *origin\/\(.*\)/\1/p' \
)" >> $GITHUB_ENV
)" | tee $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -40,13 +40,13 @@ jobs:
run: |
if [[ $RELEASE_TAG =~ (([0-9]+)\.([0-9]+)\.([0-9]+))([-./]dev([0-9]+))? ]]
then
echo "VERSION=${BASH_REMATCH[0]}" >> $GITHUB_ENV
echo "VERSION_MAJOR=${BASH_REMATCH[2]}" >> $GITHUB_ENV
echo "VERSION_MINOR=${BASH_REMATCH[3]}" >> $GITHUB_ENV
echo "VERSION_PATCH=${BASH_REMATCH[4]}" >> $GITHUB_ENV
echo "VERSION_DEV=${BASH_REMATCH[6]}" >> $GITHUB_ENV
echo "VERSION=${BASH_REMATCH[0]}" | tee $GITHUB_ENV
echo "VERSION_MAJOR=${BASH_REMATCH[2]}" | tee $GITHUB_ENV
echo "VERSION_MINOR=${BASH_REMATCH[3]}" | tee $GITHUB_ENV
echo "VERSION_PATCH=${BASH_REMATCH[4]}" | tee $GITHUB_ENV
echo "VERSION_DEV=${BASH_REMATCH[6]}" | tee $GITHUB_ENV
else
echo "INVALID_TAG=True" >> $GITHUB_ENV
echo "INVALID_TAG=True" | tee $GITHUB_ENV
fi
- name: Fail on invalid Tag
if: ${{ env.INVALID_TAG }}
Expand Down

0 comments on commit f370fea

Please sign in to comment.