5353 contents : read
5454 outputs :
5555 can_publish : ${{ steps.flags.outputs.can_publish }}
56+ run_full_validation : ${{ steps.flags.outputs.run_full_validation }}
5657 steps :
5758 - name : Harden the runner (Audit all outbound calls)
5859 uses : step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
6263 - name : Resolve publish flag
6364 id : flags
6465 shell : bash
65- run : echo "can_publish=${{ github.repository == 'GitTools/GitVersion' && github.ref_name == 'main' }}" >> "$GITHUB_OUTPUT"
66+ run : |
67+ echo "can_publish=${{ github.repository == 'GitTools/GitVersion' && github.ref_name == 'main' }}" >> "$GITHUB_OUTPUT"
68+ echo "run_full_validation=${{ github.repository == 'GitTools/GitVersion' && (github.ref_name == 'main' || github.event_name == 'merge_group' || github.event_name == 'repository_dispatch') }}" >> "$GITHUB_OUTPUT"
6669
6770 build :
6871 name : Build & Package
@@ -84,13 +87,15 @@ jobs:
8487
8588 artifacts_windows_test :
8689 name : Artifacts Windows
87- needs : [ build ]
90+ needs : [ build, publish_flags ]
8891 permissions :
8992 contents : read
9093 uses : $/.github/workflows/_artifacts_windows.yml # NOSONAR -- $/ resolves to the running commit.
94+ with :
95+ packages : ${{ fromJson(needs.publish_flags.outputs.run_full_validation) && '["Executable", "MsBuildFull"]' || '["Executable"]' }}
9196
9297 artifacts_linux_test :
93- needs : [ prepare, build ]
98+ needs : [ prepare, build, publish_flags ]
9499 name : Artifacts Linux (${{ matrix.arch }})
95100 permissions :
96101 contents : read
@@ -106,7 +111,7 @@ jobs:
106111 with :
107112 runner : ${{ matrix.runner }}
108113 arch : ${{ matrix.arch }}
109- docker_distros : ${{ needs.prepare.outputs.docker_distros }}
114+ docker_distros : ${{ fromJson( needs.publish_flags.outputs.run_full_validation) && needs. prepare.outputs.docker_distros || '["ubuntu.24.04"]' }}
110115 dotnet_versions : ${{ needs.prepare.outputs.dotnet_versions }}
111116
112117 docker_linux_images :
@@ -129,14 +134,15 @@ jobs:
129134 with :
130135 runner : ${{ matrix.runner }}
131136 arch : ${{ matrix.arch }}
132- docker_distros : ${{ needs.prepare.outputs.docker_distros }}
137+ docker_distros : ${{ fromJson( needs.publish_flags.outputs.run_full_validation) && needs. prepare.outputs.docker_distros || '["ubuntu.24.04"]' }}
133138 dotnet_versions : ${{ needs.prepare.outputs.dotnet_versions }}
134139 publish_images : ${{ fromJson(needs.publish_flags.outputs.can_publish) }}
135140 dockerhub_oidc_connection_id : ${{ vars.DOCKERHUB_OIDC_CONNECTIONID }}
136141
137142 docker_linux_manifests :
138143 needs : [ prepare, docker_linux_images, publish_flags ]
139144 name : Docker Manifests
145+ if : fromJson(needs.publish_flags.outputs.can_publish)
140146 permissions :
141147 contents : read
142148 id-token : write
@@ -164,6 +170,7 @@ jobs:
164170 release :
165171 name : Release
166172 needs : [ publish, docker_linux_manifests ]
173+ if : ${{ always() && needs.publish.result == 'success' && (needs.docker_linux_manifests.result == 'success' || needs.docker_linux_manifests.result == 'skipped') }}
167174 runs-on : windows-2025-vs2026
168175 permissions :
169176 contents : write
0 commit comments