From f75d33018eb8707294c994fc5d6a33af571e373d Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Mon, 28 Oct 2024 17:52:55 -0400 Subject: [PATCH 1/2] GitHub Actions - Cleanup Testing Matrix --- .github/workflows/ct-matrix.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ct-matrix.yml b/.github/workflows/ct-matrix.yml index ac61491..93f85cf 100644 --- a/.github/workflows/ct-matrix.yml +++ b/.github/workflows/ct-matrix.yml @@ -1,18 +1,19 @@ # This workflow is used test the project, by doing the following # 1. Ensure the project builds -# 2. Run unit tests +# 2. Run all tests # 3. Upload code coverage --- name: Testing Matrix run-name: >- ${{ format( - '{0}{1}{2} - Continuous Testing (Matrix) - ({3}-to-{4})', - github.event_name == 'pull_request' && 'PR#' || 'Push', - github.event.pull_request.draft && ' [DRAFT]' || '', - github.event_name == 'pull_request' && github.event.number || format(' [{0}]',github.ref_name), - github.event.pull_request.head.ref, - github.event.pull_request.base.ref + '{0} - Continuous Testing (Matrix){1}', + github.event_name == 'pull_request' + && format('PR#{0}{1}',github.event.number, github.event.pull_request.draft && ' [DRAFT]' || '') + || format('Push [{0}]', github.ref_name), + github.event_name == 'pull_request' + && format(' - [{0}-to-{1}]', github.event.pull_request.head.ref, github.event.pull_request.base.ref) + || '' ) }} @@ -20,14 +21,23 @@ on: push: branches: - main + - develop pull_request: branches: - main + - develop types: - opened - reopened - synchronize - ready_for_review + # Trigger if target branch was changed to a trunk + pull_request_target: + types: + - edited + branches: + - main + - develop env: build_directory: Build @@ -38,9 +48,9 @@ concurrency: cancel-in-progress: true jobs: - buildAndRunTests: - name: Continuous Testing - permissions: + tests: + name: Continuous Testing # Note: This name & matrix are used within the status checks - do not change + permissions: contents: read # Read access to code and content in the repository pull-requests: read # Read access to pull request metadata for the event checks: write # Write access to report check results @@ -53,7 +63,7 @@ jobs: dotnet-version: ["8.0.x"] steps: - - name: Checkout [${{ github.event.pull_request.head.ref }}] + - name: ${{ format('Checkout [{0}]', github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name) }} uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} From 5ab5f98b3620373fefd8b6fb849c555062addf72 Mon Sep 17 00:00:00 2001 From: Tyler Carrol Date: Mon, 28 Oct 2024 17:59:06 -0400 Subject: [PATCH 2/2] GitHub Actions - Cleanup Create Tag --- .github/workflows/merge-creates-tag.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/merge-creates-tag.yml b/.github/workflows/merge-creates-tag.yml index 82648cc..73c71d4 100644 --- a/.github/workflows/merge-creates-tag.yml +++ b/.github/workflows/merge-creates-tag.yml @@ -24,8 +24,6 @@ jobs: pull-requests: read # Needed to read pull request labels and metadata if: github.event.pull_request.merged && (contains(join(github.event.pull_request.labels.*.name, ', '), 'major') || contains(join(github.event.pull_request.labels.*.name, ', '), 'minor') || contains(join(github.event.pull_request.labels.*.name, ', '), 'patch')) runs-on: windows-2022 - outputs: - VersionNumber: ${{ steps.incrementVersion.outputs.result }} steps: - name: Checkout uses: actions/checkout@v4 @@ -72,7 +70,7 @@ jobs: git config --local user.name "github-actions[bot]" git commit -a -m "🤖 automated: Changelog ${{ steps.update-changelog.outputs.version }}" -m "Release Notes: ${{ steps.update-changelog.outputs.release-notes }}" git remote set-url origin https://@github.com/${{ github.repository }}.git - git push + git push env: PAT: ${{ secrets.TJC_TOKEN }}