From 34188c331faae47cbaf44b4ff07babc5e7f00eae Mon Sep 17 00:00:00 2001 From: Riley Evans Date: Thu, 14 Nov 2024 16:16:43 -0600 Subject: [PATCH 1/3] Added extra validation on production-build inputs --- .github/workflows/production-build.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/production-build.yml b/.github/workflows/production-build.yml index cbbb2620ffe..a7cdcdf1f6b 100644 --- a/.github/workflows/production-build.yml +++ b/.github/workflows/production-build.yml @@ -1,5 +1,5 @@ name: Production Build -run-name: Production Build - [ ${{ github.ref_name || 'branch' }} ] - ${{ github.event.inputs.release_type || 'no_type_specified' }} +run-name: Production Build - ${{ github.event.inputs.release_type || 'no_type_specified' }} on: workflow_dispatch: inputs: @@ -23,6 +23,25 @@ env: BUMP_COMMAND: pnpm run bump --release-as ${{ github.event.inputs.release_type || 'minor' }} jobs: + validation: + runs-on: ubuntu-latest + steps: + - name: Check branch and release type + id: validate + run: | + BRANCH_NAME=$(echo "${{ github.ref_name }}" | awk -F'/' '{print $NF}') + echo "Branch: $BRANCH_NAME" + + if [[ "$BRANCH_NAME" == "main" && "${{ github.event.inputs.release_type }}" == "patch" ]]; then + echo "Patch releases are not allowed on the main branch." + exit 1 + fi + + if [[ "$BRANCH_NAME" != "main" && "${{ github.event.inputs.release_type }}" != "patch" ]]; then + echo "Major and minor releases are only allowed on the main branch." + exit 1 + fi + bump-version: runs-on: ubuntu-latest steps: From 5d5acc796d9edb485b47ed3106b8721c1840cee3 Mon Sep 17 00:00:00 2001 From: Riley Evans Date: Thu, 14 Nov 2024 16:24:08 -0600 Subject: [PATCH 2/3] Added workflow_test.yml --- .github/workflows/workflow_test.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/workflow_test.yml diff --git a/.github/workflows/workflow_test.yml b/.github/workflows/workflow_test.yml new file mode 100644 index 00000000000..60598ebd95c --- /dev/null +++ b/.github/workflows/workflow_test.yml @@ -0,0 +1,43 @@ +name: workflow_test +run-name: Production Build - ${{ github.event.inputs.release_type || 'no_type_specified' }} +on: + workflow_dispatch: + inputs: + release_type: + description: 'Release type' + required: true + default: 'minor' + type: choice + options: + - major + - minor + - patch + repository_dispatch: + types: [release] + schedule: + - cron: '0 17 * * 4' + +env: + AI_KEY: 3cf0d6ae-3327-414a-b7c1-12f31ef45eff + NX_AI_CON_STR: InstrumentationKey=3cf0d6ae-3327-414a-b7c1-12f31ef45eff;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/ + BUMP_COMMAND: pnpm run bump --release-as ${{ github.event.inputs.release_type || 'minor' }} + +jobs: + validation: + runs-on: ubuntu-latest + steps: + - name: Check branch and release type + id: validate + run: | + BRANCH_NAME=$(echo "${{ github.ref_name }}" | awk -F'/' '{print $NF}') + echo "Branch: $BRANCH_NAME" + + if [[ "$BRANCH_NAME" == "main" && "${{ github.event.inputs.release_type }}" == "patch" ]]; then + echo "Patch releases are not allowed on the main branch." + exit 1 + fi + + if [[ "$BRANCH_NAME" != "main" && "${{ github.event.inputs.release_type }}" != "patch" ]]; then + echo "Major and minor releases are only allowed on the main branch." + exit 1 + fi From 73c964c2efda40feb45c0b0da70cf81baabb468f Mon Sep 17 00:00:00 2001 From: Riley Evans Date: Thu, 21 Nov 2024 13:59:36 -0600 Subject: [PATCH 3/3] Removed test file --- .github/workflows/workflow_test.yml | 43 ----------------------------- 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/workflow_test.yml diff --git a/.github/workflows/workflow_test.yml b/.github/workflows/workflow_test.yml deleted file mode 100644 index 60598ebd95c..00000000000 --- a/.github/workflows/workflow_test.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: workflow_test -run-name: Production Build - ${{ github.event.inputs.release_type || 'no_type_specified' }} -on: - workflow_dispatch: - inputs: - release_type: - description: 'Release type' - required: true - default: 'minor' - type: choice - options: - - major - - minor - - patch - repository_dispatch: - types: [release] - schedule: - - cron: '0 17 * * 4' - -env: - AI_KEY: 3cf0d6ae-3327-414a-b7c1-12f31ef45eff - NX_AI_CON_STR: InstrumentationKey=3cf0d6ae-3327-414a-b7c1-12f31ef45eff;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/ - BUMP_COMMAND: pnpm run bump --release-as ${{ github.event.inputs.release_type || 'minor' }} - -jobs: - validation: - runs-on: ubuntu-latest - steps: - - name: Check branch and release type - id: validate - run: | - BRANCH_NAME=$(echo "${{ github.ref_name }}" | awk -F'/' '{print $NF}') - echo "Branch: $BRANCH_NAME" - - if [[ "$BRANCH_NAME" == "main" && "${{ github.event.inputs.release_type }}" == "patch" ]]; then - echo "Patch releases are not allowed on the main branch." - exit 1 - fi - - if [[ "$BRANCH_NAME" != "main" && "${{ github.event.inputs.release_type }}" != "patch" ]]; then - echo "Major and minor releases are only allowed on the main branch." - exit 1 - fi