File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,21 @@ jobs:
2424 submodules : true
2525 lfs : false
2626 - name : Delete old deploy comments
27- run : |
28- $pr = "${{ github.event.pull_request.number }}"
29- gh api repos/${{ github.repository }}/issues/$pr/comments `
30- | ConvertFrom-Json `
31- | Where-Object body -like 'Azure Static Web Apps: Your stage site is ready! Visit it here: *' `
32- | ForEach-Object {
33- gh api repos/${{ github.repository }}/issues/comments/$($_.id) -X DELETE
34- }
35- shell : pwsh
27+ if : github.event_name == 'pull_request'
28+ shell : bash
3629 env :
3730 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
31+ run : |
32+ pr=${{ github.event.pull_request.number }}
33+ comments=$(gh api repos/${{ github.repository }}/issues/$pr/comments)
34+ echo "$comments" | jq -c '.[]' | while read -r comment; do
35+ body=$(echo "$comment" | jq -r '.body')
36+ id=$(echo "$comment" | jq -r '.id')
37+ if [[ "$body" == Azure\ Static\ Web\ Apps:* ]]; then
38+ echo "Deleting comment $id"
39+ gh api repos/${{ github.repository }}/issues/comments/$id -X DELETE
40+ fi
41+ done
3842 - name : Build and deploy to Azure static web apps
3943 id : builddeploy
4044 uses : Azure/static-web-apps-deploy@v1
You can’t perform that action at this time.
0 commit comments