Skip to content

Commit eb9ca6e

Browse files
fix(ci): remove duplicate preview URL comment step
Azure/static-web-apps-deploy already posts a PR comment when repo_token is provided. Remove the redundant actions/github-script step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 090a4d1 commit eb9ca6e

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

.github/workflows/preview.yml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ concurrency:
99
group: preview-${{ github.event.pull_request.number }}
1010
cancel-in-progress: true
1111

12-
permissions:
13-
pull-requests: write
14-
1512
jobs:
1613
deploy_preview:
1714
if: github.event.action != 'closed'
@@ -48,35 +45,6 @@ jobs:
4845
app_location: dist/apps/web-app/browser
4946
skip_app_build: true
5047

51-
- name: Comment preview URL on PR
52-
uses: actions/github-script@v7
53-
with:
54-
script: |
55-
const url = '${{ steps.deploy.outputs.static_web_app_url }}';
56-
const marker = '<!-- swa-preview-url -->';
57-
const body = `${marker}\n🔍 **Preview deployment:** ${url}`;
58-
const { data: comments } = await github.rest.issues.listComments({
59-
owner: context.repo.owner,
60-
repo: context.repo.repo,
61-
issue_number: context.issue.number,
62-
});
63-
const existing = comments.find(c => c.body.includes(marker));
64-
if (existing) {
65-
await github.rest.issues.updateComment({
66-
owner: context.repo.owner,
67-
repo: context.repo.repo,
68-
comment_id: existing.id,
69-
body,
70-
});
71-
} else {
72-
await github.rest.issues.createComment({
73-
owner: context.repo.owner,
74-
repo: context.repo.repo,
75-
issue_number: context.issue.number,
76-
body,
77-
});
78-
}
79-
8048
close_preview:
8149
if: github.event.action == 'closed'
8250
name: Close Preview

0 commit comments

Comments
 (0)