Fix source for KZTierMapchooser #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: preview | |
on: | |
pull_request_target: | |
types: [opened] | |
branches: [master] | |
jobs: | |
preview: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
const head = context.payload.pull_request.head; | |
const headRef = encodeURIComponent(head.ref); | |
const headRepo = encodeURIComponent(head.repo.name); | |
const headOwner = encodeURIComponent(head.repo.owner.login); | |
const params = new URLSearchParams(); | |
params.set("embed", "1"); | |
params.set("view", "preview"); | |
const previewLink = `https://stackblitz.com/github/${headOwner}/${headRepo}/tree/${headRef}?${params}`; | |
const lines = [ | |
"Hey there, below is a link to preview the changes:", | |
previewLink, | |
"", | |
`[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](${previewLink})` | |
]; | |
github.rest.issues.createComment({ | |
repo: context.repo.repo, | |
owner: context.repo.owner, | |
issue_number: context.issue.number, | |
body: lines.join("\n") | |
}); |