From 20a1a244a5c1dfa67b4369374a113f3741562530 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 12:58:57 +0200 Subject: [PATCH 1/7] Build: Update trigger conditions for Circle CI workflows --- .github/workflows/trigger-circle-ci-workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index c8c8a4c0af9c..2f8e56cbf324 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -4,7 +4,7 @@ on: # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. pull_request_target: - types: [opened, synchronize, labeled, unlabeled, reopened, converted_to_draft, ready_for_review] + types: [opened, synchronize, labeled, reopened] push: branches: - next @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal') + if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:normal' steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:docs') + if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:docs' steps: - name: Trigger docs tests run: > @@ -77,7 +77,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged') + if: github.event_name == 'push' || github.event.label.name == 'ci:merged' steps: - name: Trigger merged tests run: > @@ -96,7 +96,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:daily') + if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:daily' steps: - name: Trigger the daily tests run: > From 09653c1dbe1dd0339c53cd91c0d5a9dd06b5a2e9 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:18:31 +0200 Subject: [PATCH 2/7] Display Github Context --- .github/workflows/trigger-circle-ci-workflow.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 2f8e56cbf324..75afa9842bf1 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -3,7 +3,7 @@ name: Trigger CircleCI workflow on: # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. - pull_request_target: + pull_request: types: [opened, synchronize, labeled, reopened] push: branches: @@ -60,6 +60,11 @@ jobs: needs: get-branch if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:docs' steps: + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: | + echo "$GITHUB_CONTEXT" - name: Trigger docs tests run: > curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \ From b5331b2509b26e95f4806d77f20e771404dad21a Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:34:50 +0200 Subject: [PATCH 3/7] Apply more constraint if conditions to run certain CircleCI actions --- .github/workflows/trigger-circle-ci-workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 75afa9842bf1..fc2fbbb21cf4 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:normal' + if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:docs' + if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Dump GitHub context env: @@ -82,7 +82,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || github.event.label.name == 'ci:merged' + if: github.event_name == 'push' || (github.event.type == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) steps: - name: Trigger merged tests run: > @@ -101,7 +101,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && github.event.label.name == 'ci:daily' + if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From 6f4d27a0d4828712764756a5bc965afa4eff488b Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:40:35 +0200 Subject: [PATCH 4/7] Test --- .github/workflows/trigger-circle-ci-workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index fc2fbbb21cf4..04221dd6b9ba 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -1,7 +1,7 @@ name: Trigger CircleCI workflow on: - # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. + # Use pull_request, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. pull_request: types: [opened, synchronize, labeled, reopened] @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) + if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) + if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Dump GitHub context env: @@ -101,7 +101,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request_target' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) + if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From 7e4a26ce546fcd2b3affab5e976cb56cac16e68e Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 31 May 2024 13:43:59 +0200 Subject: [PATCH 5/7] Fix workflow --- .github/workflows/trigger-circle-ci-workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 04221dd6b9ba..b0a24cb3f7c9 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) + if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) + if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Dump GitHub context env: @@ -82,7 +82,7 @@ jobs: trigger-merged-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'push' || (github.event.type == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) + if: github.event_name == 'push' || (github.event.action == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged')) steps: - name: Trigger merged tests run: > @@ -101,7 +101,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.type == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.type != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) + if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: > From ec0823acecbdac40be95f92d3959a3c3b8303ea5 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 3 Jun 2024 14:24:17 +0200 Subject: [PATCH 6/7] Remove GitHub context logging in CI --- .github/workflows/trigger-circle-ci-workflow.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index b0a24cb3f7c9..973381a733f8 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -60,11 +60,6 @@ jobs: needs: get-branch if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: | - echo "$GITHUB_CONTEXT" - name: Trigger docs tests run: > curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \ From f78360566f53f8026821dd535c43c0fc823482e6 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Fri, 7 Jun 2024 15:03:06 +0200 Subject: [PATCH 7/7] chore: Update trigger conditions for Circle CI workflows --- .github/workflows/trigger-circle-ci-workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/trigger-circle-ci-workflow.yml b/.github/workflows/trigger-circle-ci-workflow.yml index 973381a733f8..66bcc0f1a7ce 100644 --- a/.github/workflows/trigger-circle-ci-workflow.yml +++ b/.github/workflows/trigger-circle-ci-workflow.yml @@ -1,9 +1,9 @@ name: Trigger CircleCI workflow on: - # Use pull_request, as we don't need to check out the actual code of the fork in this script. + # Use pull_request_target, as we don't need to check out the actual code of the fork in this script. # And this is the only way to trigger the Circle CI API on forks as well. - pull_request: + pull_request_target: types: [opened, synchronize, labeled, reopened] push: branches: @@ -39,7 +39,7 @@ jobs: trigger-normal-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal'))) steps: - name: Trigger Normal tests run: > @@ -58,7 +58,7 @@ jobs: trigger-docs-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs'))) steps: - name: Trigger docs tests run: > @@ -96,7 +96,7 @@ jobs: trigger-daily-tests: runs-on: ubuntu-latest needs: get-branch - if: github.event_name == 'pull_request' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) + if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily'))) steps: - name: Trigger the daily tests run: >