Skip to content

Commit ec2f84b

Browse files
committed
feature/57139_gtfsrt-metric-exporter-override-image-name - add option to override image name
1 parent 444e391 commit ec2f84b

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/ci-cd-java.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
required: false
2626
type: string
2727
default: .
28+
imageName:
29+
required: false
30+
type: string
2831

2932
env:
3033
IMAGE_NAME_MIXED_CASE: "${{ github.repository }}"
@@ -71,9 +74,17 @@ jobs:
7174
name: ${{ inputs.jarArtifactName }}
7275
path: ${{ inputs.jarArtifactPath }}
7376

74-
- name: Lowercase Docker Image Name
77+
- name: Set Docker Image Name
7578
run: |
76-
echo "IMAGE_NAME=${IMAGE_NAME_MIXED_CASE,,}" >> "${GITHUB_ENV}"
79+
OWNER="${GITHUB_REPOSITORY%%/*}"
80+
81+
if [[ -n "${{ inputs.imageName }}" ]]; then
82+
IMAGE_NAME="${OWNER,,}/${{ inputs.imageName }}"
83+
else
84+
IMAGE_NAME="${GITHUB_REPOSITORY,,}"
85+
fi
86+
87+
echo "IMAGE_NAME=${IMAGE_NAME}" >> "$GITHUB_ENV"
7788
7889
- name: Build Docker Image
7990
uses: docker/build-push-action@v6

0 commit comments

Comments
 (0)