Skip to content

Commit

Permalink
#91: moved values of build vars to a sep bash vars
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-glushko committed Apr 28, 2024
1 parent 8e0af10 commit 380821f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,26 @@ jobs:
if [[ $LABELS == *"build:dry-run"* ]]; then
DRY_RUN="true"
fi
echo "dry-run=$DRY_RUN" >> $GITHUB_OUTPUT
VERSION="${{ github.ref_name }}"
if [[ "${{ github.event_name }}" == 'pull_request' ]]; then
PR_ID=$(echo "${{ github.ref }}" | cut -d '/' -f 3)
echo "version=dev.$PR_ID" >> $GITHUB_OUTPUT
else
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
VERSION='dev.$PR_ID'
fi
echo "commit=$(git rev-parse --short '$GITHUB_SHA')" >> $GITHUB_OUTPUT
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
COMMIT=$(git rev-parse --short "$GITHUB_SHA")
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "Dry Run: $DRY_RUN"
echo "Version: $VERSION"
echo "Commit: $COMMIT"
echo "Build Date: $BUILD_DATE"
echo "dry-run=$DRY_RUN" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "commit=$COMMIT" >> $GITHUB_OUTPUT
echo "build_date=$BUILD_DATE" >> $GITHUB_OUTPUT
# lint:
# uses: ./.github/workflows/lint.yaml
Expand Down

0 comments on commit 380821f

Please sign in to comment.