Skip to content

Commit 1d904d7

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

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
@@ -1,9 +1,8 @@
11
name: Deploy preview for PR
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
6-
# branches: [main]
4+
push:
5+
branches: [main]
76
# Allow manual runs from the Actions tab
87
workflow_dispatch:
98

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 ${{ process.env.HUGO_BASEURL }} or ${{ env.HUGO_BASEURL }} or ${{ secrets.HUGO_BASEURL }}!'
21+
})

0 commit comments

Comments
 (0)