Skip to content

Commit 1a12564

Browse files
committed
feat(workflows): add workflow completion report feature
Introduced a new environment variable to enable workflow completion reporting, enhancing visibility into CI/CD process outcomes.
1 parent c3968ab commit 1a12564

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/.env.base

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ ENABLE_SECURITY_SCAN_NANCY=true # Dependency vulnerability checks
108108
# Documentation & Publishing
109109
ENABLE_GODOCS_PUBLISHING=true # Publish to pkg.go.dev on tag/releases
110110

111+
# Workflow Reporting
112+
ENABLE_COMPLETION_REPORT=true # Generate workflow completion report (adds 2-4 min)
113+
111114
# ================================================================================================
112115
# 📦 ARTIFACT DOWNLOAD CONFIGURATION
113116
# ================================================================================================

.github/workflows/fortress-setup-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ on:
176176
fork-security-mode:
177177
description: "Security mode for fork PRs (safe/unsafe)"
178178
value: ${{ jobs.setup-config.outputs.fork-security-mode }}
179+
completion-report-enabled:
180+
description: "Whether workflow completion report is enabled"
181+
value: ${{ jobs.setup-config.outputs.completion-report-enabled }}
179182
# Security: Restrictive default permissions with job-level overrides for least privilege access
180183
permissions:
181184
contents: read
@@ -229,6 +232,7 @@ jobs:
229232
redis-service-mode: ${{ steps.redis-config.outputs.redis-service-mode }}
230233
is-fork-pr: ${{ steps.fork-detection.outputs.is-fork-pr }}
231234
fork-security-mode: ${{ steps.fork-detection.outputs.fork-security-mode }}
235+
completion-report-enabled: ${{ steps.config.outputs.completion-report-enabled }}
232236
steps:
233237
# --------------------------------------------------------------------
234238
# Start timer to record workflow start time
@@ -530,6 +534,7 @@ jobs:
530534
echo "fuzz-testing-enabled=${{ env.ENABLE_FUZZ_TESTING }}" >> $GITHUB_OUTPUT
531535
echo "go-tests-enabled=${{ env.ENABLE_GO_TESTS }}" >> $GITHUB_OUTPUT
532536
echo "pre-commit-enabled=${{ env.ENABLE_GO_PRE_COMMIT }}" >> $GITHUB_OUTPUT
537+
echo "completion-report-enabled=${{ env.ENABLE_COMPLETION_REPORT }}" >> $GITHUB_OUTPUT
533538
534539
# Detect if this is a release run
535540
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then

.github/workflows/fortress.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,11 @@ jobs:
439439
# ----------------------------------------------------------------------------------
440440
completion-report:
441441
name: 📊 Workflow Completion Report
442-
if: always() && !contains(fromJSON('["failure", "cancelled"]'), needs.setup.result) && !contains(fromJSON('["failure", "cancelled"]'), needs.test-magex.result)
442+
if: |
443+
always() &&
444+
needs.setup.outputs.completion-report-enabled == 'true' &&
445+
!contains(fromJSON('["failure", "cancelled"]'), needs.setup.result) &&
446+
!contains(fromJSON('["failure", "cancelled"]'), needs.test-magex.result)
443447
needs: [load-env, setup, test-magex, pre-commit, security, code-quality, test-suite, benchmarks, release, status-check]
444448
permissions:
445449
contents: read # Read repository content for completion report

0 commit comments

Comments
 (0)