diff --git a/.github/workflows/automerge-passing-minor-patch-dependabot-prs.yml b/.github/workflows/automerge-passing-minor-patch-dependabot-prs.yml index 23b5cb1..f07615d 100644 --- a/.github/workflows/automerge-passing-minor-patch-dependabot-prs.yml +++ b/.github/workflows/automerge-passing-minor-patch-dependabot-prs.yml @@ -11,8 +11,32 @@ permissions: pull-requests: write jobs: -# works alongside branch protection rules + # works alongside branch protection rules auto-merge-minor-and-patch: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: extract update type + id: extract + run: | + pr_title="${{ github.event.pull_request.title }}" + if [[ $pr_title == *"(major)"* ]]; then + echo "update_type=major" >> $github_output + else + echo "update_type=minor_or_patch" >> $github_output + fi + + - name: set up github cli + uses: cli/cli-action@v2 + + - name: auto-merge non-major updates + if: ${{ steps.extract.outputs.update_type == 'minor_or_patch' }} + run: gh pr merge --auto --merge "$pr_url" + env: + pr_url: ${{ github.event.pull_request.html_url }} + github_token: ${{ secrets.github_token }} + + auto-merge-major: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: @@ -24,13 +48,11 @@ jobs: echo "update_type=major" >> $GITHUB_OUTPUT else echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT - fi - - name: Set up GitHub CLI uses: cli/cli-action@v2 - - - name: Auto-merge non-major updates - if: ${{ steps.extract.outputs.update_type == 'minor_or_patch' }} + + - name: Auto-merge major updates + if: ${{ steps.extract.outputs.update_type == 'major' }} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 371ddcc..853771e 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -28,6 +28,4 @@ jobs: UNITTESTS_APPSETTINGS_PRODUCTION: ${{ secrets.UNITTESTS_APPSETTINGS_PRODUCTION }} WASMSTATICCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSTATICCLIENT_APPSETTINGS_PRODUCTION }} WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION }} - WASMSERVERHOST_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }} - - + WASMSERVERHOST_APPSETTINGS_PRODUCTION: ${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }} \ No newline at end of file diff --git a/.github/workflows/reuseable-ci-checks.yml b/.github/workflows/reuseable-ci-checks.yml index f213cda..ad7c1af 100644 --- a/.github/workflows/reuseable-ci-checks.yml +++ b/.github/workflows/reuseable-ci-checks.yml @@ -33,8 +33,7 @@ on: required: true TEL_GIT_PACKAGES_TOKEN: required: true - - + env: # Permission @@ -134,7 +133,6 @@ jobs: /p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \ /p:DisablePackageGeneration=true - reuseable-ci-checks-branch-name-check: name: Check branch names if: success() || failure() @@ -186,17 +184,6 @@ jobs: exit 1 fi - # qqqq drop - # if [[ "$BRANCH_NAME" =~ ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|sample|security|config|bugfix|hotfix)-[a-zA-Z0-9._/-]+$ ]] || [[ "$BRANCH_NAME" == "master" ]]; then - # echo "✅ Branch name is valid" - # else - # echo "❌ Invalid branch name: $BRANCH_NAME" - # echo "Branch names must follow one of the allowed prefixes:" - # echo " build-*, feat-*, fix-*, bugfix-*, hotfix-*, build-*, chore-*, ci-*, docs-*, perf-*, refactor-*, revert-*, style-*, test-*, sample-*, security-*, config-*, bugfix-*, hotfix-*" - # exit 1 - # fi - - reuseable-ci-checks-commitlint: name: Check commit names runs-on: ubuntu-latest @@ -313,7 +300,6 @@ jobs: - name: Ensure browsers are installed run: pwsh TELBlazor.Components.ShowCase.E2ETests/bin/Release/net8.0/playwright.ps1 install --with-deps - - name: Run tests with coverage threshold check id: unit_e2e_tests run: | @@ -379,7 +365,6 @@ jobs: echo "❌ One or more steps failed." exit 1 - reuseable-ci-checks-check-for-failed-jobs: name: Check for failures if: ${{ inputs.runall }}