From 16505c99d80ff46f46d0ca4a51b349a3bf3c7246 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:47:45 +0200 Subject: [PATCH 01/16] test patch --- .github/workflows/run_patch.yaml | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/run_patch.yaml diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml new file mode 100644 index 000000000..e843717da --- /dev/null +++ b/.github/workflows/run_patch.yaml @@ -0,0 +1,71 @@ +## Canary CI/CD +name: Canary +run-name: Canary + +on: + # push: + # branches: + # - master + # - patch-version + # paths-ignore: + # - '.github/workflows/**' + + workflow_dispatch: +# inputs: +# branch: +# description: 'branch name' +# required: false +# default: 'master' +# scripts-to-execute: +# description: 'scripts to execute' +# required: false +# type: string +# default: 'build lint type-check test' +# is-patch-version: +# description: "patch version" +# required: true +# type: boolean +# default: false + + +jobs: + set_stage_variable: + runs-on: ubuntu-latest + outputs: + id: stage + value: ${{ steps.stage.outputs.stage }} + steps: + - name: Output stage + id: stage + run: | + if [[ "${{ inputs.is-patch-version }}" == "true" ]]; then + stage="patch" + else + stage="canary" + fi + echo $stage + echo "stage=${stage}" >> $GITHUB_OUTPUT + get_branch_name: + runs-on: ubuntu-latest + outputs: + id: branch-name + value: ${{ steps.branch-name.outputs.name }} + steps: + - name: Output branch name + id: name + run: | + name=$(echo ${GITHUB_REF#refs/heads/}) + echo $name + echo "name=${name}" >> $GITHUB_OUTPUT +# canary: +# uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@master +# secrets: inherit +# with: +# node-version: "20.x" +# player-type: "ovp tv" +# schema-type: "playerV3Versions" +# tests-yarn-run-to-execute: ${{ inputs.scripts-to-execute }} +# yarn-upgrade-list: "" +# is-patch-version: ${{ inputs.is-patch-version }} +# stage: $STAGE_VALUE +# stage: ${{ needs.set_stage_variable.outputs.stage }} From 793fe8a7f286d8fea14d5eb05d06b184fdeb4bef Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:49:03 +0200 Subject: [PATCH 02/16] on push --- .github/workflows/run_patch.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index e843717da..895c3308c 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -3,14 +3,11 @@ name: Canary run-name: Canary on: - # push: - # branches: - # - master - # - patch-version - # paths-ignore: - # - '.github/workflows/**' + push: + branches: + - * - workflow_dispatch: +# workflow_dispatch: # inputs: # branch: # description: 'branch name' From f2bfc9852caf7dd386543a720610c16abedbd04f Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:50:08 +0200 Subject: [PATCH 03/16] fix syntax --- .github/workflows/run_patch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index 895c3308c..f528298de 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -5,7 +5,7 @@ run-name: Canary on: push: branches: - - * + * # workflow_dispatch: # inputs: From 64fbd274c5e532f30277ffe0cfcc3692e8c448d4 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:50:57 +0200 Subject: [PATCH 04/16] fix syntax --- .github/workflows/run_patch.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index f528298de..9e68ba62f 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -3,9 +3,9 @@ name: Canary run-name: Canary on: - push: - branches: - * + push: + branches: + - * # workflow_dispatch: # inputs: From 40b39161cb88f030a3ba99e29aba9009cdbf6279 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:52:00 +0200 Subject: [PATCH 05/16] fix syntax --- .github/workflows/run_patch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index 9e68ba62f..ea2de14b8 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -5,7 +5,7 @@ run-name: Canary on: push: branches: - - * + - '*' # workflow_dispatch: # inputs: From 3f34a1732803427853df54e984eae8d2816c7b4c Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:05:18 +0200 Subject: [PATCH 06/16] on workflow dispatch --- .github/workflows/run_patch.yaml | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index ea2de14b8..ed35ca389 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -7,7 +7,7 @@ on: branches: - '*' -# workflow_dispatch: + workflow_dispatch: # inputs: # branch: # description: 'branch name' @@ -26,22 +26,22 @@ on: jobs: - set_stage_variable: - runs-on: ubuntu-latest - outputs: - id: stage - value: ${{ steps.stage.outputs.stage }} - steps: - - name: Output stage - id: stage - run: | - if [[ "${{ inputs.is-patch-version }}" == "true" ]]; then - stage="patch" - else - stage="canary" - fi - echo $stage - echo "stage=${stage}" >> $GITHUB_OUTPUT +# set_stage_variable: +# runs-on: ubuntu-latest +# outputs: +# id: stage +# value: ${{ steps.stage.outputs.stage }} +# steps: +# - name: Output stage +# id: stage +# run: | +# if [[ "${{ inputs.is-patch-version }}" == "true" ]]; then +# stage="patch" +# else +# stage="canary" +# fi +# echo $stage +# echo "stage=${stage}" >> $GITHUB_OUTPUT get_branch_name: runs-on: ubuntu-latest outputs: @@ -51,7 +51,7 @@ jobs: - name: Output branch name id: name run: | - name=$(echo ${GITHUB_REF#refs/heads/}) + name=${GITHUB_REF#refs/heads/} echo $name echo "name=${name}" >> $GITHUB_OUTPUT # canary: From 4eb83957864c506296c8326803be1a48a3251594 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:05:44 +0200 Subject: [PATCH 07/16] change workflow name --- .github/workflows/run_patch.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index ed35ca389..df7e00ed2 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -1,6 +1,6 @@ ## Canary CI/CD -name: Canary -run-name: Canary +name: Patch +run-name: Patch on: push: From 3cf81bab2bf18078e3d21e7efaf483054d71433b Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:29:37 +0200 Subject: [PATCH 08/16] on workflow dispatch --- .github/workflows/run_patch.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index df7e00ed2..d27a41400 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -3,11 +3,12 @@ name: Patch run-name: Patch on: + workflow_dispatch: push: branches: - '*' - workflow_dispatch: +# workflow_dispatch: # inputs: # branch: # description: 'branch name' From 55c5bea9517c9cba56b5483971ec094f961b92ea Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:30:38 +0200 Subject: [PATCH 09/16] on workflow dispatch --- .github/workflows/run_patch.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index d27a41400..c41bc7841 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -3,12 +3,16 @@ name: Patch run-name: Patch on: - workflow_dispatch: push: branches: - '*' -# workflow_dispatch: + workflow_dispatch: + inputs: + branch: + description: 'Optional description for the input' + required: false + default: 'default_value' # inputs: # branch: # description: 'branch name' From 75408aa34b7958436e49f39ad8eb43039e4d73ee Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Mon, 22 Jan 2024 16:33:05 +0200 Subject: [PATCH 10/16] on workflow dispatch --- .github/workflows/run_patch.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index c41bc7841..b27412180 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -3,16 +3,11 @@ name: Patch run-name: Patch on: - push: - branches: - - '*' +# push: +# branches: +# - '*' workflow_dispatch: - inputs: - branch: - description: 'Optional description for the input' - required: false - default: 'default_value' # inputs: # branch: # description: 'branch name' From bb4e25b1af75cc7b4be8daa6bbaf19dffb96490a Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:37:24 +0200 Subject: [PATCH 11/16] try checkout from branch --- .github/workflows/run_patch.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index b27412180..6ef9381ea 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -3,11 +3,11 @@ name: Patch run-name: Patch on: -# push: -# branches: -# - '*' + push: + branches: + - '*' - workflow_dispatch: +# workflow_dispatch: # inputs: # branch: # description: 'branch name' @@ -54,6 +54,14 @@ jobs: name=${GITHUB_REF#refs/heads/} echo $name echo "name=${name}" >> $GITHUB_OUTPUT + checkout_code: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }} + ref: $ {{ needs.branch-name.outputs.branch-name }} # canary: # uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@master # secrets: inherit From d4b3f66dfdeacdac7fd60ba8e0b9c930811797cc Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:38:29 +0200 Subject: [PATCH 12/16] fix syntax --- .github/workflows/run_patch.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index 6ef9381ea..76c3c3635 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -58,10 +58,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }} - ref: $ {{ needs.branch-name.outputs.branch-name }} + uses: actions/checkout@v3 + with: + token: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }} + ref: $ {{ needs.branch-name.outputs.branch-name }} # canary: # uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@master # secrets: inherit From 4586382c8ae0edbd6238a48ddf0530dc10341bd6 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:40:46 +0200 Subject: [PATCH 13/16] fix syntax --- .github/workflows/run_patch.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index 76c3c3635..5dd618856 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -54,6 +54,8 @@ jobs: name=${GITHUB_REF#refs/heads/} echo $name echo "name=${name}" >> $GITHUB_OUTPUT + echo "github.ref ---->" + echo ${{ github.token }} checkout_code: runs-on: ubuntu-latest steps: @@ -61,7 +63,7 @@ jobs: uses: actions/checkout@v3 with: token: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }} - ref: $ {{ needs.branch-name.outputs.branch-name }} + ref: ${{ needs.branch-name.outputs.branch-name }} # canary: # uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@master # secrets: inherit From 7508abf45c6dce0438e3cc9bb2a9771c56a09384 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:41:34 +0200 Subject: [PATCH 14/16] print github.ref --- .github/workflows/run_patch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index 5dd618856..6237cb655 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -55,7 +55,7 @@ jobs: echo $name echo "name=${name}" >> $GITHUB_OUTPUT echo "github.ref ---->" - echo ${{ github.token }} + echo ${{ github.ref }} checkout_code: runs-on: ubuntu-latest steps: From 79e6c75a65ec339e05f5d69b9ef2e3b6345e2d60 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:53:55 +0200 Subject: [PATCH 15/16] verify check out from branch --- .github/workflows/run_patch.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index 6237cb655..a00e2a030 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -64,6 +64,14 @@ jobs: with: token: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }} ref: ${{ needs.branch-name.outputs.branch-name }} + - name: Verify Checked-Out Branch + run: | + checked_out_branch=$(git rev-parse --abbrev-ref HEAD) + echo "checked out branch --->" + echo $checked_out_branch + if [ "$checked_out_branch" != "${GITHUB_REF#refs/heads/}" ]; then + echo "Error: Checked out branch ($checked_out_branch) does not match the workflow branch (${GITHUB_REF#refs/heads/})" + fi # canary: # uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@master # secrets: inherit From b0ecf9e9b488d9dde5ce21a5816f87ce1dc034d6 Mon Sep 17 00:00:00 2001 From: lianbenjamin <79077248+lianbenjamin@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:28:46 +0200 Subject: [PATCH 16/16] use run_patch from branch in common --- .github/workflows/run_patch.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/run_patch.yaml b/.github/workflows/run_patch.yaml index a00e2a030..ea2c69c11 100644 --- a/.github/workflows/run_patch.yaml +++ b/.github/workflows/run_patch.yaml @@ -7,12 +7,12 @@ on: branches: - '*' -# workflow_dispatch: -# inputs: -# branch: -# description: 'branch name' -# required: false -# default: 'master' + workflow_dispatch: + inputs: + branch: + description: 'branch name' + required: false + default: 'master' # scripts-to-execute: # description: 'scripts to execute' # required: false @@ -72,15 +72,15 @@ jobs: if [ "$checked_out_branch" != "${GITHUB_REF#refs/heads/}" ]; then echo "Error: Checked out branch ($checked_out_branch) does not match the workflow branch (${GITHUB_REF#refs/heads/})" fi -# canary: -# uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@master -# secrets: inherit -# with: -# node-version: "20.x" -# player-type: "ovp tv" -# schema-type: "playerV3Versions" -# tests-yarn-run-to-execute: ${{ inputs.scripts-to-execute }} -# yarn-upgrade-list: "" + canary: + uses: kaltura/playkit-js-common/.github/workflows/canary_player.yaml@lian-test-canary + secrets: inherit + with: + node-version: "20.x" + player-type: "ovp tv" + schema-type: "playerV3Versions" + tests-yarn-run-to-execute: 'build lint type-check test' + yarn-upgrade-list: "" # is-patch-version: ${{ inputs.is-patch-version }} # stage: $STAGE_VALUE # stage: ${{ needs.set_stage_variable.outputs.stage }}