diff --git a/.github/workflows/preview-packages.yml b/.github/workflows/preview-packages.yml index f4faa9a..34e96e9 100644 --- a/.github/workflows/preview-packages.yml +++ b/.github/workflows/preview-packages.yml @@ -43,8 +43,8 @@ jobs: shell: bash env: EVENT_NAME: ${{ github.event_name }} - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} + REF_TYPE: ${{ needs.release-gate.outputs.publish == 'true' && 'tag' || github.ref_type }} + REF_NAME: ${{ needs.release-gate.outputs.publish == 'true' && needs.release-gate.outputs.tag || github.ref_name }} INPUT_TAG: ${{ inputs.tag }} TAG_COMMIT: ${{ github.sha }} MAIN_REF: origin/main @@ -68,8 +68,8 @@ jobs: shell: bash env: EVENT_NAME: ${{ github.event_name }} - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} + REF_TYPE: ${{ needs.release-gate.outputs.publish == 'true' && 'tag' || github.ref_type }} + REF_NAME: ${{ needs.release-gate.outputs.publish == 'true' && needs.release-gate.outputs.tag || github.ref_name }} PR_NUMBER: ${{ github.event.pull_request.number }} RUN_NUMBER: ${{ github.run_number }} RELEASE_TAG: ${{ needs.release-gate.outputs.tag }} @@ -125,8 +125,8 @@ jobs: shell: bash env: EVENT_NAME: ${{ github.event_name }} - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} + REF_TYPE: ${{ needs.release-gate.outputs.publish == 'true' && 'tag' || github.ref_type }} + REF_NAME: ${{ needs.release-gate.outputs.publish == 'true' && needs.release-gate.outputs.tag || github.ref_name }} PR_NUMBER: ${{ github.event.pull_request.number }} RUN_NUMBER: ${{ github.run_number }} RELEASE_TAG: ${{ needs.release-gate.outputs.tag }} @@ -197,8 +197,8 @@ jobs: shell: bash env: EVENT_NAME: ${{ github.event_name }} - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} + REF_TYPE: ${{ needs.release-gate.outputs.publish == 'true' && 'tag' || github.ref_type }} + REF_NAME: ${{ needs.release-gate.outputs.publish == 'true' && needs.release-gate.outputs.tag || github.ref_name }} PR_NUMBER: ${{ github.event.pull_request.number }} RUN_NUMBER: ${{ github.run_number }} RELEASE_TAG: ${{ needs.release-gate.outputs.tag }} diff --git a/tests/PackagingAudit/Program.cs b/tests/PackagingAudit/Program.cs index ba630fb..d5d1fdc 100644 --- a/tests/PackagingAudit/Program.cs +++ b/tests/PackagingAudit/Program.cs @@ -153,6 +153,9 @@ void Check(bool condition, string name) workflow.Contains("github.event_name == 'workflow_dispatch' && 'main' || needs.release-gate.outputs.build_commit", StringComparison.Ordinal) && workflow.Contains("--notes-file", StringComparison.Ordinal), "The guarded workflow locks one reviewed commit and atomically publishes one exact curated GitHub pre-release with repaired recovery orchestration"); +Check(workflow.Split("needs.release-gate.outputs.publish == 'true' && 'tag' || github.ref_type", StringSplitOptions.None).Length - 1 == 4 && + workflow.Split("needs.release-gate.outputs.publish == 'true' && needs.release-gate.outputs.tag || github.ref_name", StringSplitOptions.None).Length - 1 == 4, + "Every package job presents a validated recovery run to immutable-tag-era metadata scripts as the exact RC tag"); Check(workflow.Contains("*.dmg", StringComparison.Ordinal) && workflow.Contains("*.AppImage", StringComparison.Ordinal) && !Regex.IsMatch(workflow + macScript + linuxScript, @"(?i)zip[^\n]*(?:\.dmg|\.AppImage)"),