Skip to content

Commit 1396317

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

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

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

Lines changed: 0 additions & 13 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

@@ -65,18 +64,6 @@ jobs:
6564
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
6665
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6766

68-
- name: Post Preview Link to PR
69-
uses: actions/github-script@v7
70-
with:
71-
github-token: ${{secrets.GITHUB_TOKEN}}
72-
script: |
73-
github.rest.issues.createComment({
74-
owner: context.repo.owner,
75-
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-
});
79-
8067
invalidate-cache:
8168
needs: build-and-deploy-preview
8269
runs-on: ubuntu-latest
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)