Skip to content

Commit

Permalink
Update TryThisPR.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Oct 3, 2024
1 parent f968c47 commit 819b452
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/TryThisPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,37 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:

- uses: denoland/setup-deno@v1
with:
deno-version: "1.16.1"
- uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
require("fs").writeFileSync("context.json", JSON.stringify(context))
- name: Generate comment
id: generate-comment
run: |
deno eval '
const context = JSON.parse(await Deno.readTextFile("context.json"));
const body = `
## Try this Pull Request!
Open Julia and type:
\`\`\`jl
julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="${context.payload.pull_request.head.repo.html_url}", rev="${context.payload.pull_request.head.ref}")
julia> using ${context.payload.repository.name.replace(/\.jl$/,"")}
\`\`\`
`
await Deno.writeTextFile("comment.txt", body);
'
- uses: nefrob/pr-description@v1.1.2
with:
content: |
## Try this Pull Request!
Open Julia and type:
\`\`\`jl
julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="${context.payload.pull_request.head.repo.html_url}", rev="${context.payload.pull_request.head.ref}")
julia> using ${context.payload.repository.name.replace(/\.jl$/,"")}
\`\`\`
content: "comment.txt"
contentIsFilePath: "true"
regex: "jkhsdkjhasdfkjhawkejfbawkehfkajshdfkjahsdf"
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 819b452

Please sign in to comment.