Skip to content

Commit 646ac2d

Browse files
committed
ci: try and leave comment
1 parent d66e6a5 commit 646ac2d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/azure-static-web-apps-polite-cliff-0173aa90f.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ jobs:
3535
output_location: "dist"
3636
app_build_command: "yarn build:docs"
3737

38+
- name: Add preview url to PR
39+
if: github.event_name == 'pull_request'
40+
uses: actions/github-scripts@7
41+
with:
42+
script: |
43+
const deployUrl = process.env.SWA_URL || (core.getOutput('deployment-url'));
44+
if (!deployUrl) return;
45+
const comment = `PR preview deployed at: ${deployUrl}`;
46+
github.rest.issues.createComment({
47+
issue_number: context.issue.number,
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
body: comment
51+
})
52+
env:
53+
SWA_URL: ${{ steps.swa.outputs.static_web_app_url }}
54+
3855
close_pull_request_job:
3956
if: github.event.action == 'closed'
4057
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)