mirror of https://github.com/FOME-Tech/wiki.git
Add Comment on PR to preview
This commit is contained in:
parent
7319551562
commit
f03e65c126
|
@ -42,6 +42,7 @@ jobs:
|
|||
- run: unzip build.zip -d build
|
||||
|
||||
- name: Deploy preview to Cloudflare Pages
|
||||
id: deploy
|
||||
uses: cloudflare/pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
|
@ -50,3 +51,21 @@ jobs:
|
|||
directory: build
|
||||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} # GitHub Deployments
|
||||
wranglerVersion: '3'
|
||||
|
||||
- name: 'Comment on PR'
|
||||
uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
try {
|
||||
const issue_number = Number(fs.readFileSync('./build/PR_NR'));
|
||||
await github.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue_number,
|
||||
body: "Preview URL: ${{ steps.deploy.outputs.alias }}"
|
||||
});
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue