Skip to content

Commit 5e1a154

Browse files
committed
ci: try and leave comment
1 parent d66e6a5 commit 5e1a154

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
submodules: true
2525
lfs: false
26-
- name: Build And Deploy
26+
- name: Build And deokiy to Azure Static Web Apps
2727
id: builddeploy
2828
uses: Azure/static-web-apps-deploy@v1
2929
with:
@@ -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-script@v7
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)