Skip to content

Merge pull request #4699 from project-koku/release_prod-ros.20521 #156

Merge pull request #4699 from project-koku/release_prod-ros.20521

Merge pull request #4699 from project-koku/release_prod-ros.20521 #156

Workflow file for this run

name: Tag Release
on:
push:
branches:
- prod-hccm
- prod-ros
env:
BRANCH: ${{ github.ref }}
jobs:
tag_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ env.BRANCH }}
- run: |
git fetch --prune --unshallow
- name: Tag this release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DATE=$(date +"%Y.%m.%d")
PREV_RELEASE=$(git tag --list | tail -1)
MINOR_VERSION=0
case $PREV_RELEASE in
*"$DATE"*)
MINOR_VERSION=$(echo "$PREV_RELEASE" | cut -d'.' -f5)
MINOR_VERSION=$((MINOR_VERSION+1))
;;
*)
MINOR_VERSION=0
;;
esac
BRANCH_BASE=$( echo $BRANCH | cut -d'/' -f3)
APP_PREFIX=$(echo "$BRANCH_BASE" | cut -d'-' -f2)
TAG="r-$APP_PREFIX.$DATE.$MINOR_VERSION"
git config --local user.email "[email protected]"
git config --local user.name "Cost Management Release Action"
git log $(git tag --list | tail -1)..$BRANCH_BASE | git tag -a $TAG -F -
git push origin $TAG
shell: bash