File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 workflow_dispatch :
55 inputs :
66 docker_image_tag :
7- description : ' Docker Image Tag (yyyyMMdd)'
8- required : true
7+ description : ' Docker Image Tag (yyyyMMdd). Leave empty to use the current UTC date '
8+ required : false
99
1010env :
1111 DEBIAN_FRONTEND : noninteractive
@@ -20,12 +20,18 @@ jobs:
2020 timeout-minutes : 60
2121
2222 steps :
23- - name : validate input
23+ - name : resolve docker image tag
24+ id : resolve_tag
2425 run : |
25- if [[ ! ${{ github.event.inputs.docker_image_tag }} =~ ^[0-9]{8}$ ]]; then
26- echo "::error Invalid tag name '${{ github.event.inputs.docker_image_tag }}'"
26+ tag="${{ github.event.inputs.docker_image_tag }}"
27+ if [[ -z "$tag" ]]; then
28+ tag=$(date -u +%Y%m%d)
29+ fi
30+ if [[ ! $tag =~ ^[0-9]{8}$ ]]; then
31+ echo "::error Invalid tag name '$tag'"
2732 exit 1
2833 fi
34+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
2935
3036 - uses : actions/checkout@v7
3137 with :
4450 context : .
4551 file : packaging/docker/${{ env.DOCKER_IMAGE_NAME1 }}/Dockerfile
4652 push : true
47- tags : ghcr.io/shimat/opencvsharp/${{ env.DOCKER_IMAGE_NAME1 }}:${{ github.event.inputs.docker_image_tag }}
53+ tags : ghcr.io/shimat/opencvsharp/${{ env.DOCKER_IMAGE_NAME1 }}:${{ steps.resolve_tag.outputs.tag }}
You can’t perform that action at this time.
0 commit comments