From 0f0f54ddd12da91c8eb2835e5adef874183377d1 Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 6 Feb 2024 21:55:05 -0800 Subject: [PATCH] Update UploadAndNotify.yml --- .github/workflows/UploadAndNotify.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/UploadAndNotify.yml b/.github/workflows/UploadAndNotify.yml index 4e3087da..214cc680 100644 --- a/.github/workflows/UploadAndNotify.yml +++ b/.github/workflows/UploadAndNotify.yml @@ -25,19 +25,19 @@ jobs: az storage blob upload --account-name poweraccelerators --container-name accelerators --name simplefile.txt --file simplefile.txt --overwrite --account-key ${{ secrets.AZURE_STORAGE_KEY }} - name: Generate SAS Token + id: sas_token run: | $expiry = (Get-Date).AddDays(365).ToString("yyyy-MM-ddTHH:mm:ssZ") $sasToken = az storage blob generate-sas --account-name poweraccelerators --container-name accelerators --name simplefile.txt --permissions r --expiry $expiry --account-key ${{ secrets.AZURE_STORAGE_KEY }} --output json echo "SAS JSON: $sasToken" - echo "SAS_TOKEN=$sasToken" >> $GITHUB_ENV - $sasURL = "https://poweraccelerators.blob.core.windows.net/accelerators/simplefile.txt?$sasToken" >> $GITHUB_ENV - echo "SAS URL: $sasURL" + echo "SAS_TOKEN=$sasToken" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "::set-output name=sas_token::$sasToken" shell: pwsh - name: Post Adaptive Card to Microsoft Teams run: | - $sasTok = $env:SAS_TOKEN - echo "Sas Token: $sasTok" + $sasToken = "${{ steps.sas_token.outputs.sas_token }}" + echo "Sas Token: $sasToken" $body = @{ type = "message" attachments = @( @@ -51,14 +51,14 @@ jobs: body = @( @{ type = "TextBlock" - text = "$sasTok" + text = "$sasToken" } ) actions = @( @{ type = "Action.OpenUrl" title = "Download Azure Blob File" - url = "${{ env.SAS_URL }}" + url = "$sasToken" } ) }