From 990722a4431afdd5eaa20d9aec437cedd219453b Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 13:33:04 +0700 Subject: [PATCH 01/17] update --- .github/workflows/020-manual-input-workflow.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 9fc79bc..b706d9c 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -8,6 +8,14 @@ on: workflow_dispatch: # Inputs the workflow accepts. inputs: + official-image: + description: 'Official Image' + required: false + default: 'false' + type: choice + options: + - true + - false name: # Friendly description to be shown in the UI instead of 'name' description: 'Person to greet' @@ -28,3 +36,5 @@ jobs: # Runs a single command using the runners shell - name: Send greeting run: echo "Hello ${{ github.event.inputs.name }}" + - name: Send greeting2 + run: echo "Hello ${{ github.event.inputs.official-image }}" From db38f0fd20bfe1dfbaf31b1fdfaf366258631aa1 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 13:47:24 +0700 Subject: [PATCH 02/17] update --- .github/workflows/020-manual-input-workflow.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index b706d9c..68ee9be 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -37,4 +37,9 @@ jobs: - name: Send greeting run: echo "Hello ${{ github.event.inputs.name }}" - name: Send greeting2 - run: echo "Hello ${{ github.event.inputs.official-image }}" + run: | + if [[ ${{ github.event.inputs.official-image }} == true ]]; then + echo "version tag is true" + else + echo "There is no github tag reference, skipping" + fi From 4807e7f2542a6278f7a9836f064379a2ee7e9e96 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 13:56:47 +0700 Subject: [PATCH 03/17] update --- .github/workflows/020-manual-input-workflow.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 68ee9be..83d6453 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -24,6 +24,12 @@ on: # Input has to be provided for the workflow to run required: true +env: + REGISTRY: useast.jfrog.lexisnexisrisk.com + ARTIFACT: hcare-docker-dev-virtual + IMAGE_NAME: hc-cat-api-tokenlistservice + VERSION: "${{ github.event.inputs.official-image }} == true ? 'xbx' : 'latest'" + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "greet" @@ -35,7 +41,7 @@ jobs: steps: # Runs a single command using the runners shell - name: Send greeting - run: echo "Hello ${{ github.event.inputs.name }}" + run: echo "Hello ${{ env.VERSION }}" - name: Send greeting2 run: | if [[ ${{ github.event.inputs.official-image }} == true ]]; then From d1d7bcefd62ad505aebc31ca6fc6982173364311 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 13:58:51 +0700 Subject: [PATCH 04/17] update --- .github/workflows/020-manual-input-workflow.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 83d6453..50cdc4c 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -28,7 +28,7 @@ env: REGISTRY: useast.jfrog.lexisnexisrisk.com ARTIFACT: hcare-docker-dev-virtual IMAGE_NAME: hc-cat-api-tokenlistservice - VERSION: "${{ github.event.inputs.official-image }} == true ? 'xbx' : 'latest'" + VERSION: "${{ github.event.inputs.official-image }} === 'true' ? 'xbx' : 'latest'" # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -41,7 +41,9 @@ jobs: steps: # Runs a single command using the runners shell - name: Send greeting - run: echo "Hello ${{ env.VERSION }}" + run: echo "Hello ${{ env.VERSION1 }}" + env: + VERSION1: "${{ github.event.inputs.official-image }} === 'true' ? 'xbx' : 'latest'" - name: Send greeting2 run: | if [[ ${{ github.event.inputs.official-image }} == true ]]; then From 7af2500f7e72d0568ba65bd84738df44a5192ffd Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:03:42 +0700 Subject: [PATCH 05/17] update --- .github/workflows/020-manual-input-workflow.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 50cdc4c..6eae6c1 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -28,7 +28,7 @@ env: REGISTRY: useast.jfrog.lexisnexisrisk.com ARTIFACT: hcare-docker-dev-virtual IMAGE_NAME: hc-cat-api-tokenlistservice - VERSION: "${{ github.event.inputs.official-image }} === 'true' ? 'xbx' : 'latest'" + VERSION: ${{ github.event.inputs.name || 'latest' }} # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -41,9 +41,7 @@ jobs: steps: # Runs a single command using the runners shell - name: Send greeting - run: echo "Hello ${{ env.VERSION1 }}" - env: - VERSION1: "${{ github.event.inputs.official-image }} === 'true' ? 'xbx' : 'latest'" + run: echo "Hello ${{ env.VERSION }}" - name: Send greeting2 run: | if [[ ${{ github.event.inputs.official-image }} == true ]]; then From 39c88920b2ce1765ab0a7d6e8ca7af56bda94177 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:04:52 +0700 Subject: [PATCH 06/17] update --- .github/workflows/020-manual-input-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 6eae6c1..5ec255a 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -20,9 +20,9 @@ on: # Friendly description to be shown in the UI instead of 'name' description: 'Person to greet' # Default value if no value is explicitly provided - default: 'World' + default: '' # Input has to be provided for the workflow to run - required: true + required: false env: REGISTRY: useast.jfrog.lexisnexisrisk.com From a2cc43a1c5969eb84c12b567933bdba13379f528 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:10:49 +0700 Subject: [PATCH 07/17] update --- .github/workflows/020-manual-input-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 5ec255a..69f9dc0 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -28,7 +28,7 @@ env: REGISTRY: useast.jfrog.lexisnexisrisk.com ARTIFACT: hcare-docker-dev-virtual IMAGE_NAME: hc-cat-api-tokenlistservice - VERSION: ${{ github.event.inputs.name || 'latest' }} + VERSION: ${{ github.event.inputs.name == 'test', "hahahtest",'not testhahaha' }} # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: From 05385bd21a1a90e28f6d2d054760d287c7f5dbf3 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:16:51 +0700 Subject: [PATCH 08/17] update --- .github/workflows/020-manual-input-workflow.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 69f9dc0..df178b1 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -28,7 +28,6 @@ env: REGISTRY: useast.jfrog.lexisnexisrisk.com ARTIFACT: hcare-docker-dev-virtual IMAGE_NAME: hc-cat-api-tokenlistservice - VERSION: ${{ github.event.inputs.name == 'test', "hahahtest",'not testhahaha' }} # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -40,8 +39,6 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Runs a single command using the runners shell - - name: Send greeting - run: echo "Hello ${{ env.VERSION }}" - name: Send greeting2 run: | if [[ ${{ github.event.inputs.official-image }} == true ]]; then @@ -49,3 +46,13 @@ jobs: else echo "There is no github tag reference, skipping" fi + - name: Sets env vars for release + run: | + echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" + if: ${{ github.event.inputs.name == 'test'}} + - name: Sets env vars for staging + run: | + echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" + if: ${{ github.event.inputs.name != 'test'}} + - name: Send greeting + run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From f34e80295e09d9aa19aa12e2cb44b250733bce8d Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:19:11 +0700 Subject: [PATCH 09/17] update --- .github/workflows/020-manual-input-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index df178b1..1c80cb4 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -49,10 +49,10 @@ jobs: - name: Sets env vars for release run: | echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" - if: ${{ github.event.inputs.name == 'test'}} + if: startsWith(github.event.inputs.name, 'test') - name: Sets env vars for staging run: | echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" - if: ${{ github.event.inputs.name != 'test'}} + if: startsWith(github.event.inputs.name, 'abc') - name: Send greeting run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From e3d9cf3c550a991d26d37daa6c4c36f8eff7e584 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:20:55 +0700 Subject: [PATCH 10/17] update --- .github/workflows/020-manual-input-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 1c80cb4..ccd17fa 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -55,4 +55,4 @@ jobs: echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" if: startsWith(github.event.inputs.name, 'abc') - name: Send greeting - run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file + run: echo "Hello ${{ DOCKER_IMAGE_NAME }}" \ No newline at end of file From c7572d684bad1b2a3d74355e9bc221b7c3d845ca Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:23:07 +0700 Subject: [PATCH 11/17] update --- .github/workflows/020-manual-input-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index ccd17fa..2f63cd6 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -48,11 +48,11 @@ jobs: fi - name: Sets env vars for release run: | - echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" + echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" >> $GITHUB_ENV if: startsWith(github.event.inputs.name, 'test') - name: Sets env vars for staging run: | - echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" + echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" >> $GITHUB_ENV if: startsWith(github.event.inputs.name, 'abc') - name: Send greeting run: echo "Hello ${{ DOCKER_IMAGE_NAME }}" \ No newline at end of file From 98587c690f957265e88dd5a9c7fc5cc4493c7f4f Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:25:32 +0700 Subject: [PATCH 12/17] update --- .github/workflows/020-manual-input-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index 2f63cd6..f673ac8 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -55,4 +55,4 @@ jobs: echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" >> $GITHUB_ENV if: startsWith(github.event.inputs.name, 'abc') - name: Send greeting - run: echo "Hello ${{ DOCKER_IMAGE_NAME }}" \ No newline at end of file + run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From 3687014cd8ee2f1b19ecc5a95fe90dbf9c5bf38f Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:29:19 +0700 Subject: [PATCH 13/17] update --- .github/workflows/020-manual-input-workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index f673ac8..fdf1ec1 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -20,7 +20,7 @@ on: # Friendly description to be shown in the UI instead of 'name' description: 'Person to greet' # Default value if no value is explicitly provided - default: '' + default: 'latest' # Input has to be provided for the workflow to run required: false @@ -49,10 +49,10 @@ jobs: - name: Sets env vars for release run: | echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" >> $GITHUB_ENV - if: startsWith(github.event.inputs.name, 'test') + if: ${{ github.event.inputs.official-image == true}} - name: Sets env vars for staging run: | echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" >> $GITHUB_ENV - if: startsWith(github.event.inputs.name, 'abc') + if: ${{ github.event.inputs.official-image != true}} - name: Send greeting run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From 937767b197c58970d88ed663bb9c301a74ec81ac Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:37:07 +0700 Subject: [PATCH 14/17] update --- .github/workflows/020-manual-input-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index fdf1ec1..b48514f 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -49,10 +49,10 @@ jobs: - name: Sets env vars for release run: | echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" >> $GITHUB_ENV - if: ${{ github.event.inputs.official-image == true}} + if: ${{ github.event.inputs.official-image == 'true'}} - name: Sets env vars for staging run: | echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" >> $GITHUB_ENV - if: ${{ github.event.inputs.official-image != true}} + if: ${{ github.event.inputs.official-image != 'true'}} - name: Send greeting run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From ab7140bf73d5d78b4c7c2e712e4f9f845cf3ac3f Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:41:14 +0700 Subject: [PATCH 15/17] update --- .github/workflows/020-manual-input-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index b48514f..d6b1991 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -52,7 +52,7 @@ jobs: if: ${{ github.event.inputs.official-image == 'true'}} - name: Sets env vars for staging run: | - echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:staging" >> $GITHUB_ENV - if: ${{ github.event.inputs.official-image != 'true'}} + echo "DOCKER_IMAGE_NAME=uuid::$(uuidgen)" >> $GITHUB_ENV + if: ${{ github.event.inputs.official-image == 'false'}} - name: Send greeting run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From 8554215b1db226524ce3a80b47602e6e1307e6e9 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 14:42:09 +0700 Subject: [PATCH 16/17] update --- .github/workflows/020-manual-input-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/020-manual-input-workflow.yml b/.github/workflows/020-manual-input-workflow.yml index d6b1991..c4d87cf 100644 --- a/.github/workflows/020-manual-input-workflow.yml +++ b/.github/workflows/020-manual-input-workflow.yml @@ -52,7 +52,7 @@ jobs: if: ${{ github.event.inputs.official-image == 'true'}} - name: Sets env vars for staging run: | - echo "DOCKER_IMAGE_NAME=uuid::$(uuidgen)" >> $GITHUB_ENV + echo "DOCKER_IMAGE_NAME=$(uuidgen)" >> $GITHUB_ENV if: ${{ github.event.inputs.official-image == 'false'}} - name: Send greeting run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file From d569cc61738cf75a7a6eb26fbe5047a402bc61f7 Mon Sep 17 00:00:00 2001 From: Dung Nguyen Date: Sat, 28 Jan 2023 19:13:56 +0700 Subject: [PATCH 17/17] update --- .../workflows/020-manual-input-workflow12.yml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/020-manual-input-workflow12.yml diff --git a/.github/workflows/020-manual-input-workflow12.yml b/.github/workflows/020-manual-input-workflow12.yml new file mode 100644 index 0000000..6cb3aca --- /dev/null +++ b/.github/workflows/020-manual-input-workflow12.yml @@ -0,0 +1,58 @@ +# This is a basic workflow that is manually triggered + +name: 020-manual-input-workflow12 + +# Controls when the action will run. Workflow runs when manually triggered using the UI +# or API. +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + official-image: + description: 'Official Image' + required: false + default: 'false' + type: choice + options: + - true + - false + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Person to greet' + # Default value if no value is explicitly provided + default: 'latest' + # Input has to be provided for the workflow to run + required: false + +env: + REGISTRY: useast.jfrog.lexisnexisrisk.com + ARTIFACT: hcare-docker-dev-virtual + IMAGE_NAME: hc-cat-api-tokenlistservice + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send greeting2 + run: | + if [[ ${{ github.event.inputs.official-image }} == true ]]; then + echo "version tag is true" + else + echo "There is no github tag reference, skipping" + fi + - name: Sets env vars for release + run: | + echo "DOCKER_IMAGE_NAME=my.docker.repo/awesome-image:release" >> $GITHUB_ENV + if: ${{ github.event.inputs.official-image == 'true'}} + - name: Sets env vars for staging + run: | + echo "DOCKER_IMAGE_NAME=$(uuidgen)" >> $GITHUB_ENV + if: ${{ github.event.inputs.official-image == 'false'}} + - name: Send greeting + run: echo "Hello ${{ env.DOCKER_IMAGE_NAME }}" \ No newline at end of file