Skip to content

Commit 939e2c4

Browse files
Merge pull request #51 from devopsabcs-engineering/feature/2139-use-app-url-secret-for-scan-target
fix(workflows): use APP_URL secret for scan target and auto-update on deploy AB#2139
2 parents f55b22e + cbc599c commit 939e2c4

11 files changed

Lines changed: 56 additions & 5 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
HTTP_STATUS=$(curl -s -o results/a11y-demo-app-001.sarif -w "%{http_code}" \
2929
-X POST "${{ env.SCANNER_BASE_URL }}/api/ci/scan" \
3030
-H "Content-Type: application/json" \
31-
-d '{"url": "https://a11y-demo-app-001-app.azurewebsites.net/", "format": "sarif"}' \
31+
-d '{"url": "${{ secrets.APP_URL }}", "format": "sarif"}' \
3232
--max-time 120)
3333
3434
echo "Attempt $attempt - HTTP status: $HTTP_STATUS"

a11y-demo-app-001/.github/workflows/ci-cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ jobs:
103103
echo "Deployed to: $SITE_URL"
104104
echo "site_url=$SITE_URL" >> "$GITHUB_OUTPUT"
105105
106+
- name: Update APP_URL secret
107+
env:
108+
GH_TOKEN: ${{ secrets.ORG_ADMIN_TOKEN }}
109+
run: |
110+
gh secret set APP_URL --repo "${{ github.repository }}" --body "${{ steps.deploy-container.outputs.site_url }}"
111+
echo "APP_URL secret updated"
112+
106113
- name: Capture deployment screenshot
107114
run: |
108115
echo "Waiting for app to warm up..."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
HTTP_STATUS=$(curl -s -o results/a11y-demo-app-002.sarif -w "%{http_code}" \
2929
-X POST "${{ env.SCANNER_BASE_URL }}/api/ci/scan" \
3030
-H "Content-Type: application/json" \
31-
-d '{"url": "https://a11y-demo-app-002-app.azurewebsites.net/", "format": "sarif"}' \
31+
-d '{"url": "${{ secrets.APP_URL }}", "format": "sarif"}' \
3232
--max-time 120)
3333
3434
echo "Attempt $attempt - HTTP status: $HTTP_STATUS"

a11y-demo-app-002/.github/workflows/ci-cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ jobs:
103103
echo "Deployed to: $SITE_URL"
104104
echo "site_url=$SITE_URL" >> "$GITHUB_OUTPUT"
105105
106+
- name: Update APP_URL secret
107+
env:
108+
GH_TOKEN: ${{ secrets.ORG_ADMIN_TOKEN }}
109+
run: |
110+
gh secret set APP_URL --repo "${{ github.repository }}" --body "${{ steps.deploy-container.outputs.site_url }}"
111+
echo "APP_URL secret updated"
112+
106113
- name: Capture deployment screenshot
107114
run: |
108115
echo "Waiting for app to warm up..."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
HTTP_STATUS=$(curl -s -o results/a11y-demo-app-003.sarif -w "%{http_code}" \
2929
-X POST "${{ env.SCANNER_BASE_URL }}/api/ci/scan" \
3030
-H "Content-Type: application/json" \
31-
-d '{"url": "https://a11y-demo-app-003-app.azurewebsites.net/", "format": "sarif"}' \
31+
-d '{"url": "${{ secrets.APP_URL }}", "format": "sarif"}' \
3232
--max-time 120)
3333
3434
echo "Attempt $attempt - HTTP status: $HTTP_STATUS"

a11y-demo-app-003/.github/workflows/ci-cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ jobs:
103103
echo "Deployed to: $SITE_URL"
104104
echo "site_url=$SITE_URL" >> "$GITHUB_OUTPUT"
105105
106+
- name: Update APP_URL secret
107+
env:
108+
GH_TOKEN: ${{ secrets.ORG_ADMIN_TOKEN }}
109+
run: |
110+
gh secret set APP_URL --repo "${{ github.repository }}" --body "${{ steps.deploy-container.outputs.site_url }}"
111+
echo "APP_URL secret updated"
112+
106113
- name: Capture deployment screenshot
107114
run: |
108115
echo "Waiting for app to warm up..."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
HTTP_STATUS=$(curl -s -o results/a11y-demo-app-004.sarif -w "%{http_code}" \
2929
-X POST "${{ env.SCANNER_BASE_URL }}/api/ci/scan" \
3030
-H "Content-Type: application/json" \
31-
-d '{"url": "https://a11y-demo-app-004-app.azurewebsites.net/", "format": "sarif"}' \
31+
-d '{"url": "${{ secrets.APP_URL }}", "format": "sarif"}' \
3232
--max-time 120)
3333
3434
echo "Attempt $attempt - HTTP status: $HTTP_STATUS"

a11y-demo-app-004/.github/workflows/ci-cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ jobs:
103103
echo "Deployed to: $SITE_URL"
104104
echo "site_url=$SITE_URL" >> "$GITHUB_OUTPUT"
105105
106+
- name: Update APP_URL secret
107+
env:
108+
GH_TOKEN: ${{ secrets.ORG_ADMIN_TOKEN }}
109+
run: |
110+
gh secret set APP_URL --repo "${{ github.repository }}" --body "${{ steps.deploy-container.outputs.site_url }}"
111+
echo "APP_URL secret updated"
112+
106113
- name: Capture deployment screenshot
107114
run: |
108115
echo "Waiting for app to warm up..."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
HTTP_STATUS=$(curl -s -o results/a11y-demo-app-005.sarif -w "%{http_code}" \
2929
-X POST "${{ env.SCANNER_BASE_URL }}/api/ci/scan" \
3030
-H "Content-Type: application/json" \
31-
-d '{"url": "https://a11y-demo-app-005-app.azurewebsites.net/", "format": "sarif"}' \
31+
-d '{"url": "${{ secrets.APP_URL }}", "format": "sarif"}' \
3232
--max-time 120)
3333
3434
echo "Attempt $attempt - HTTP status: $HTTP_STATUS"

a11y-demo-app-005/.github/workflows/ci-cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ jobs:
103103
echo "Deployed to: $SITE_URL"
104104
echo "site_url=$SITE_URL" >> "$GITHUB_OUTPUT"
105105
106+
- name: Update APP_URL secret
107+
env:
108+
GH_TOKEN: ${{ secrets.ORG_ADMIN_TOKEN }}
109+
run: |
110+
gh secret set APP_URL --repo "${{ github.repository }}" --body "${{ steps.deploy-container.outputs.site_url }}"
111+
echo "APP_URL secret updated"
112+
106113
- name: Capture deployment screenshot
107114
run: |
108115
echo "Waiting for app to warm up..."

0 commit comments

Comments
 (0)