From cf8619edd0717ff717b418744c8dd6b3b296cf2f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 19 Oct 2024 15:56:53 -0400 Subject: [PATCH] Leave a comment on PRs. --- .github/workflows/emscripten.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 6abfe25..28687c7 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -45,8 +45,10 @@ jobs: echo DEPLOY_FOLDER=/ ;; refs/pull/*/merge) - echo "${{github.ref}}" | \ - sed "s/refs.pull./DEPLOY_FOLDER=prs\//; s/.merge//" + sed "s/refs.pull./DEPLOY_FOLDER=prs\//; s/.merge//" + pr=$(echo "${{github.ref}}" | sed "s/refs.pull./; s/.merge//") + echo "DEPLOY_FOLDER=/prs/$pr" + echo "PR_NUMBER=$pr" ;; refs/tags/*) echo "${{github.ref}}" | sed "s/refs.tags./DEPLOY_FOLDER=tags\//" @@ -64,3 +66,12 @@ jobs: target-folder: "${{steps.deploy_folder.outputs.DEPLOY_FOLDER}}" clean: true commit-message: "Build from fragglet/sdl-sopwith@${{github.sha}}" + - name: Comment PR + if: ${{ github.event_name == 'pull_request' }} + uses: thollander/actions-comment-pull-request@v3 + with: + message: | + Thanks for your pull request! A build of your change can be found + [here](https://fragglet.github.io/sdl-sopwith-latest${{steps.deploy_folder.outputs.DEPLOY_FOLDER}}/sopwith.html) + for people to try. + pr_number: ${{steps.deploy_folder.outputs.PR_NUMBER}}