Skip to content

Commit 914c2f7

Browse files
Merge pull request #49 from devopsabcs-engineering/feature/2137-fix-scanner-url-and-deploy-summary
fix(workflows): use SCANNER_URL secret in scan workflows and add deploy summary AB#2137
2 parents a5afc4b + 61c5401 commit 914c2f7

7 files changed

Lines changed: 74 additions & 5 deletions

File tree

.github/workflows/deploy-all.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,52 @@ jobs:
148148
--name infra-deploy \
149149
--query 'properties.outputs.webAppUrl.value' -o tsv)
150150
echo "Deployed scan demo app to: $SITE_URL"
151+
echo "scanner_url=$SITE_URL" >> "$GITHUB_OUTPUT"
152+
id: deploy-scanner
153+
154+
# ── Deployment summary with clickable links ──
155+
summary:
156+
name: Deployment Summary
157+
runs-on: ubuntu-latest
158+
needs:
159+
- dispatch-apps
160+
- deploy-scan-demo
161+
steps:
162+
- name: Azure Login
163+
uses: azure/login@v2
164+
with:
165+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
166+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
167+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
168+
169+
- name: Generate deployment summary
170+
run: |
171+
echo "## 🚀 All Demo Apps Deployed" >> $GITHUB_STEP_SUMMARY
172+
echo "" >> $GITHUB_STEP_SUMMARY
173+
echo "| App | Language | URL |" >> $GITHUB_STEP_SUMMARY
174+
echo "|-----|----------|-----|" >> $GITHUB_STEP_SUMMARY
175+
for i in 001 002 003 004 005; do
176+
RG="rg-a11y-demo-app-${i}"
177+
URL=$(az deployment group show \
178+
--resource-group "$RG" \
179+
--name infra-deploy \
180+
--query 'properties.outputs.webAppUrl.value' -o tsv 2>/dev/null || echo "N/A")
181+
case $i in
182+
001) LANG="Rust" ;;
183+
002) LANG="C#" ;;
184+
003) LANG="Java" ;;
185+
004) LANG="Python" ;;
186+
005) LANG="Go" ;;
187+
esac
188+
echo "| App ${i} | ${LANG} | [${URL}](${URL}) |" >> $GITHUB_STEP_SUMMARY
189+
done
190+
SCANNER_URL=$(az deployment group show \
191+
--resource-group rg-a11y-scan-demo \
192+
--name infra-deploy \
193+
--query 'properties.outputs.webAppUrl.value' -o tsv 2>/dev/null || echo "N/A")
194+
echo "" >> $GITHUB_STEP_SUMMARY
195+
echo "### Scanner App" >> $GITHUB_STEP_SUMMARY
196+
echo "**URL:** [${SCANNER_URL}](${SCANNER_URL})" >> $GITHUB_STEP_SUMMARY
151197
152198
# ── Teardown (requires approval via 'teardown' environment) ──
153199
teardown:

a11y-demo-app-001/.github/workflows/a11y-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9-
SCANNER_BASE_URL: https://a11y-scan-demo-app.azurewebsites.net
9+
SCANNER_BASE_URL: ${{ secrets.SCANNER_URL }}
1010

1111
permissions:
1212
security-events: write

a11y-demo-app-002/.github/workflows/a11y-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9-
SCANNER_BASE_URL: https://a11y-scan-demo-app.azurewebsites.net
9+
SCANNER_BASE_URL: ${{ secrets.SCANNER_URL }}
1010

1111
permissions:
1212
security-events: write

a11y-demo-app-003/.github/workflows/a11y-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9-
SCANNER_BASE_URL: https://a11y-scan-demo-app.azurewebsites.net
9+
SCANNER_BASE_URL: ${{ secrets.SCANNER_URL }}
1010

1111
permissions:
1212
security-events: write

a11y-demo-app-004/.github/workflows/a11y-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9-
SCANNER_BASE_URL: https://a11y-scan-demo-app.azurewebsites.net
9+
SCANNER_BASE_URL: ${{ secrets.SCANNER_URL }}
1010

1111
permissions:
1212
security-events: write

a11y-demo-app-005/.github/workflows/a11y-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
env:
9-
SCANNER_BASE_URL: https://a11y-scan-demo-app.azurewebsites.net
9+
SCANNER_BASE_URL: ${{ secrets.SCANNER_URL }}
1010

1111
permissions:
1212
security-events: write

scripts/bootstrap-demo-apps.ps1

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ if ($null -eq $OrgAdminToken) {
5959
$OrgAdminToken = Read-Host -Prompt 'Enter ORG_ADMIN_TOKEN for wiki push (or press Enter to skip)'
6060
}
6161

62+
# Resolve scanner URL from Azure deployment or environment variable
63+
$ScannerUrl = $env:SCANNER_URL
64+
if (-not $ScannerUrl) {
65+
$null = az account show 2>&1
66+
if ($LASTEXITCODE -eq 0) {
67+
$ScannerUrl = az deployment group show --resource-group rg-a11y-scan-demo --name infra-deploy --query 'properties.outputs.webAppUrl.value' -o tsv 2>$null
68+
}
69+
}
70+
if (-not $ScannerUrl) {
71+
$ScannerUrl = Read-Host -Prompt 'Enter SCANNER_URL (scanner app base URL, or press Enter to skip)'
72+
}
73+
6274
# Run OIDC setup if Azure CLI is logged in and secrets are being configured
6375
if ($ConfigureSecrets) {
6476
$null = az account show 2>&1
@@ -213,6 +225,17 @@ foreach ($app in $DemoApps) {
213225
}
214226
}
215227

228+
if ($ScannerUrl) {
229+
Write-Host " Configuring SCANNER_URL for a11y scan workflow..." -ForegroundColor Gray
230+
try {
231+
gh secret set SCANNER_URL --repo $fullRepo --body $ScannerUrl
232+
Write-Host " SCANNER_URL configured." -ForegroundColor Green
233+
}
234+
catch {
235+
Write-Host " Warning: Could not configure SCANNER_URL: $_" -ForegroundColor Yellow
236+
}
237+
}
238+
216239
# Initialize wiki (required before workflows can push to it)
217240
if ($OrgAdminToken) {
218241
Write-Host " Initializing wiki..." -ForegroundColor Gray

0 commit comments

Comments
 (0)