From 819b452b98995429aa6cba2cf401ee3df99437c5 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Thu, 3 Oct 2024 21:27:23 +0200 Subject: [PATCH] Update TryThisPR.yml --- .github/workflows/TryThisPR.yml | 40 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/TryThisPR.yml b/.github/workflows/TryThisPR.yml index 62cfecf04..bea09f6d1 100644 --- a/.github/workflows/TryThisPR.yml +++ b/.github/workflows/TryThisPR.yml @@ -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 }}