Skip to content

Commit 61fdb59

Browse files
committed
Fix workflow lint and release summary handling
1 parent 375c652 commit 61fdb59

3 files changed

Lines changed: 37 additions & 25 deletions

File tree

.github/actionlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
self-hosted-runner:
2+
labels:
3+
- linux
4+
- x64
5+
- kvm

.github/workflows/ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,9 @@ jobs:
561561
echo "=== Checking internal doc links ==="
562562
ERRORS=0
563563
# Find all markdown links to local files
564-
for md in $(find docs/ README.md CONTRIBUTING.md SECURITY.md -name '*.md' 2>/dev/null); do
564+
while IFS= read -r md; do
565565
# Extract relative links (not URLs, not anchors)
566-
grep -oP '\[([^\]]*)\]\((?!https?://|#)([^)]+)\)' "$md" 2>/dev/null | \
567-
grep -oP '\(([^)]+)\)' | tr -d '()' | while read -r link; do
566+
while IFS= read -r link; do
568567
# Strip anchor fragments
569568
target="${link%%#*}"
570569
[ -z "$target" ] && continue
@@ -575,8 +574,8 @@ jobs:
575574
echo "BROKEN: ${md} -> ${link} (resolved: ${resolved})"
576575
ERRORS=$((ERRORS + 1))
577576
fi
578-
done
579-
done
577+
done < <(grep -oP '\[([^\]]*)\]\((?!https?://|#)([^)]+)\)' "$md" 2>/dev/null | grep -oP '\(([^)]+)\)' | tr -d '()')
578+
done < <(find docs/ README.md CONTRIBUTING.md SECURITY.md -name '*.md' 2>/dev/null)
580579
if [ "$ERRORS" -gt 0 ]; then
581580
echo "FAIL: ${ERRORS} broken internal links found"
582581
exit 1
@@ -849,6 +848,8 @@ jobs:
849848

850849
- name: Release gate summary
851850
run: |
852-
echo "## Release Gate: PASSED" >> "$GITHUB_STEP_SUMMARY"
853-
echo "Branch: ${{ github.ref_name }}" >> "$GITHUB_STEP_SUMMARY"
854-
echo "All hardened checks passed for release branch." >> "$GITHUB_STEP_SUMMARY"
851+
{
852+
echo "## Release Gate: PASSED"
853+
echo "Branch: ${{ github.ref_name }}"
854+
echo "All hardened checks passed for release branch."
855+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/release.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,12 @@ jobs:
362362
if [ -n "$DIGEST" ] && [ "$DIGEST" != "null" ]; then
363363
echo "${DIGEST}" > dist/IMAGE_DIGEST
364364
echo "${IMAGE_REF}@${DIGEST}" > dist/IMAGE_REF_PINNED
365-
echo "## Install with digest pinning" >> "$GITHUB_STEP_SUMMARY"
366-
echo '```bash' >> "$GITHUB_STEP_SUMMARY"
367-
echo "sudo bash secai-bootstrap.sh --digest ${DIGEST}" >> "$GITHUB_STEP_SUMMARY"
368-
echo '```' >> "$GITHUB_STEP_SUMMARY"
365+
{
366+
echo "## Install with digest pinning"
367+
echo '```bash'
368+
echo "sudo bash secai-bootstrap.sh --digest ${DIGEST}"
369+
echo '```'
370+
} >> "$GITHUB_STEP_SUMMARY"
369371
else
370372
echo "WARNING: Could not extract image digest for tag ${TAG}"
371373
echo "unknown" > dist/IMAGE_DIGEST
@@ -484,7 +486,8 @@ jobs:
484486
- name: Generate SHA256 checksums
485487
run: |
486488
cd dist
487-
sha256sum * > SHA256SUMS
489+
rm -f SHA256SUMS
490+
find . -maxdepth 1 -type f -print0 | sort -z | xargs -0 sha256sum > SHA256SUMS
488491
cat SHA256SUMS
489492
490493
- name: Sign checksums with cosign
@@ -505,10 +508,11 @@ jobs:
505508
run: |
506509
for sbom in dist/*-sbom.cdx.json; do
507510
service=$(basename "$sbom" -sbom.cdx.json)
511+
image_ref="ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${service}"
508512
cosign attest --yes --type cyclonedx \
509513
--predicate "$sbom" \
510514
--key env://COSIGN_PRIVATE_KEY \
511-
ghcr.io/${{ github.repository }}:${{ github.ref_name }}-${service} || \
515+
"$image_ref" || \
512516
echo "WARN: cosign attest skipped for ${service} (no matching image)"
513517
done
514518
env:
@@ -540,14 +544,16 @@ jobs:
540544
- name: Note on large artifacts
541545
if: ${{ !inputs.dry_run }}
542546
run: |
543-
echo "## Large Artifacts" >> "$GITHUB_STEP_SUMMARY"
544-
echo "" >> "$GITHUB_STEP_SUMMARY"
545-
echo "Install media files can exceed GitHub Releases' 2GB limit." >> "$GITHUB_STEP_SUMMARY"
546-
echo "Their cosign signatures (.sig) are included in the release." >> "$GITHUB_STEP_SUMMARY"
547-
echo "Full images are available as workflow artifacts (90-day retention)." >> "$GITHUB_STEP_SUMMARY"
548-
for f in dist/secai-os-*.iso dist/secai-os-*-usb.raw.xz dist/secai-os-*.qcow2 dist/secai-os-*.ova; do
549-
[ -f "$f" ] || continue
550-
SIZE=$(stat -c%s "$f" 2>/dev/null || echo 0)
551-
SIZE_MB=$((SIZE / 1048576))
552-
echo " - $(basename "$f"): ${SIZE_MB} MB" >> "$GITHUB_STEP_SUMMARY"
553-
done
547+
{
548+
echo "## Large Artifacts"
549+
echo ""
550+
echo "Install media files can exceed GitHub Releases' 2GB limit."
551+
echo "Their cosign signatures (.sig) are included in the release."
552+
echo "Full images are available as workflow artifacts (90-day retention)."
553+
for f in dist/secai-os-*.iso dist/secai-os-*-usb.raw.xz dist/secai-os-*.qcow2 dist/secai-os-*.ova; do
554+
[ -f "$f" ] || continue
555+
SIZE=$(stat -c%s "$f" 2>/dev/null || echo 0)
556+
SIZE_MB=$((SIZE / 1048576))
557+
echo " - $(basename "$f"): ${SIZE_MB} MB"
558+
done
559+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)