Skip to content

Commit 0de55c9

Browse files
committed
feat: test posting comments
1 parent 1efdb65 commit 0de55c9

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

.github/workflows/pr-deploy-preview.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Deploy preview for PR
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened]
6-
# branches: [main]
76
# Allow manual runs from the Actions tab
87
workflow_dispatch:
98

@@ -71,11 +70,11 @@ jobs:
7170
github-token: ${{secrets.GITHUB_TOKEN}}
7271
script: |
7372
github.rest.issues.createComment({
73+
issue_number: context.issue.number,
7474
owner: context.repo.owner,
7575
repo: context.repo.repo,
76-
issue_number: context.payload.pull_request.number,
77-
body: `🎉 A preview of this PR is available at: [${process.env.HUGO_BASEURL}](${process.env.HUGO_BASEURL})`
78-
});
76+
body: `🎉 A preview of this PR is available at: ${{ env.HUGO_BASEURL }} `
77+
})
7978
8079
invalidate-cache:
8180
needs: build-and-deploy-preview
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
# Trigger the workflow on push or pull request
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
6+
jobs:
7+
comment:
8+
runs-on: ubuntu-latest
9+
env:
10+
HUGO_BASEURL: "https://preview-developer.espressif.com/pr${{ github.event.pull_request.number }}/"
11+
steps:
12+
- name: Post Preview Link to PR
13+
uses: actions/github-script@v7
14+
with:
15+
github-token: ${{secrets.GITHUB_TOKEN}}
16+
script: |
17+
github.rest.issues.createComment({
18+
issue_number: context.issue.number,
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
body: `🎉 A preview of this PR is available at: ${{ env.HUGO_BASEURL }} `
22+
})

0 commit comments

Comments
 (0)