Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/preview-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
shell: bash
env:
EVENT_NAME: ${{ github.event_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 }}
REF_TYPE: ${{ github.ref_type }}
REF_NAME: ${{ github.ref_name }}
INPUT_TAG: ${{ inputs.tag }}
TAG_COMMIT: ${{ github.sha }}
MAIN_REF: origin/main
Expand Down Expand Up @@ -269,8 +269,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 }}
Expand Down
18 changes: 18 additions & 0 deletions tests/PackagingAudit/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,24 @@ void Check(bool condition, string name)
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");
var releaseGateSection = workflow[(workflow.IndexOf("release-gate:", StringComparison.Ordinal))..workflow.IndexOf("windows-release:", StringComparison.Ordinal)];
Check(releaseGateSection.Contains("REF_TYPE: ${{ github.ref_type }}", StringComparison.Ordinal) &&
!releaseGateSection.Contains("needs.release-gate.outputs.publish", StringComparison.Ordinal),
"The release authority never self-references downstream outputs while validating the requested tag");
foreach (var (packageJob, nextJob) in new[]
{
("windows-release:", "macos-x64-preview:"),
("macos-x64-preview:", "macos-arm64-preview:"),
("macos-arm64-preview:", "linux-preview:"),
("linux-preview:", "required-platform-packages:")
})
{
var start = workflow.IndexOf(packageJob, StringComparison.Ordinal);
var end = workflow.IndexOf(nextJob, start + packageJob.Length, StringComparison.Ordinal);
var section = workflow[start..end];
Check(section.Contains("needs.release-gate.outputs.publish == 'true' && 'tag' || github.ref_type", StringComparison.Ordinal),
$"{packageJob.TrimEnd(':')} receives the validated RC identity during recovery");
}
Check(workflow.Contains("*.dmg", StringComparison.Ordinal) &&
workflow.Contains("*.AppImage", StringComparison.Ordinal) &&
!Regex.IsMatch(workflow + macScript + linuxScript, @"(?i)zip[^\n]*(?:\.dmg|\.AppImage)"),
Expand Down
Loading