Skip to content

Commit

Permalink
test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Chethan-rao committed Nov 21, 2023
1 parent 5cbb22d commit 0254650
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@ jobs:
- name: Docker tag creation with trigger event being 'push'
if: ${{ github.event_name == 'push' }}
shell: bash
run: echo "DOCKER_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
run: |
echo "DOCKER_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
if [[ ${{ github.ref_type }} == 'tag' ]]; then
DOCKER_TAG=$GITHUB_REF_NAME
else
git fetch origin $GITHUB_REF_NAME
DOCKER_TAG=$(git rev-parse --short=7 "$GITHUB_REF_NAME^{commit}")
fi
echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV
echo "docker_tag: $DOCKER_TAG"
echo "tag2: ${{ env.DOCKER_TAG }}"
- shell: bash
run: |
echo "tag2: ${{ env.DOCKER_TAG }}"
- name: Docker tag creation with trigger event being 'workflow_dispatch'
if: ${{ github.event_name == 'workflow_dispatch' }}
Expand Down

0 comments on commit 0254650

Please sign in to comment.