Skip to content

Commit 6d0db96

Browse files
committed
feat: test posting comments
1 parent 1efdb65 commit 6d0db96

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

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

Lines changed: 2 additions & 3 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

@@ -73,8 +72,8 @@ jobs:
7372
github.rest.issues.createComment({
7473
owner: context.repo.owner,
7574
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})`
75+
issue_number: context.issue.number,
76+
body: `🎉 A preview of this PR is available at: [${{ env.HUGO_BASEURL }}](${{ env.HUGO_BASEURL }})`
7877
});
7978
8079
invalidate-cache:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
- uses: actions/github-script@v7
13+
with:
14+
github-token: ${{secrets.GITHUB_TOKEN}}
15+
script: |
16+
github.rest.issues.createComment({
17+
issue_number: context.issue.number,
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
body: '👋 Test comment in PR${{ github.event.pull_request.number }} in ${{ env.HUGO_BASEURL }}!'
21+
})

0 commit comments

Comments
 (0)