Skip to content

Commit

Permalink
get tag from manual input
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroBarillaPXL committed Oct 3, 2024
1 parent b2226c8 commit b3db1f6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
push:
branches:
- main
workflow_dispatch:
inputs:
tag:
description: 'Custom input for tags'
required: false

jobs:
test:
Expand All @@ -23,12 +28,13 @@ jobs:
steps:
- name: Set image tag
run: |
COMMIT_MSG="${{ github.event.head_commit.message }}"
if [[ "$COMMIT_MSG" == "[TAG]"* ]]; then
TAG=$(echo $COMMIT_MSG | grep -oP '(?<=\[TAG\])\S+')
echo "TAG=$TAG" >> $GITHUB_ENV
echo "TAG: $TAG"
#source: https://chatgpt.com/share/66fe5874-6410-8009-ab95-d2fe9956a708
if [[ ${{inputs.tag}} == '' ]]; then
echo "TAG is not provided, using latest"
echo "TAG=latest" >> $GITHUB_ENV
else
echo "TAG is provided, using ${{inputs.tag}}"
echo "TAG=${{inputs.tag}}" >> $GITHUB_ENV
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down

0 comments on commit b3db1f6

Please sign in to comment.