Skip to content

Commit f703a86

Browse files
committed
fix(azure-preview-workflow): remove sas tokens; use env vars
1 parent a475ee1 commit f703a86

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/publish-site.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ permissions:
2828
contents: read
2929
pull-requests: write
3030

31+
env:
32+
AZCOPY_AUTO_LOGIN_TYPE: SPN
33+
AZCOPY_SPA_APPLICATION_ID: ${{ secrets.AZURE_CLIENT_ID }}
34+
AZCOPY_SPA_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
35+
AZCOPY_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
36+
3137
jobs:
3238
build_and_deploy_job:
3339
if: github.event_name == 'pull_request' && github.event.action != 'closed'
@@ -88,13 +94,11 @@ jobs:
8894
- name: Deploy to Azure Blob Storage
8995
id: deploy
9096
env:
91-
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
9297
PR_HASH: ${{ steps.pr_hash.outputs.hash }}
9398
run: |
94-
CLEAN_SAS_TOKEN=$(echo "${AZURE_STORAGE_SAS_TOKEN}" | tr -d '\n\r\t ')
9599
echo "Uploading Storybook to ${PR_HASH}"
96100
azcopy copy "/home/runner/work/spectrum-css/spectrum-css/dist/*" --log-level=INFO \
97-
"https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/?${CLEAN_SAS_TOKEN}" \
101+
"https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/" \
98102
--recursive \
99103
--from-to LocalBlob
100104
docs_url="https://spectrumcss.z13.web.core.windows.net/${PR_HASH}"
@@ -128,11 +132,9 @@ jobs:
128132
sudo mv azcopy /usr/local/bin/
129133
- name: Clean up PR deployment
130134
env:
131-
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
132135
PR_HASH: ${{ steps.pr_hash.outputs.hash }}
133136
run: |
134-
CLEAN_SAS_TOKEN=$(echo "${AZURE_STORAGE_SAS_TOKEN}" | tr -d '\n\r\t ')
135137
echo "Cleaning up deployment: ${PR_HASH}/"
136-
azcopy remove "https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/?${CLEAN_SAS_TOKEN}" \
138+
azcopy remove "https://spectrumcss.blob.core.windows.net/\$web/${PR_HASH}/" \
137139
--recursive || echo "Cleanup completed (some files may not exist)"
138140
echo "Cleanup completed for PR deployment: ${PR_HASH}/"

0 commit comments

Comments
 (0)