From c3c08fa38a3ea99776f18448ebb978b7c54e3e84 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Wed, 8 Oct 2025 10:20:12 +0200 Subject: [PATCH] Fix preview build on contributor PRs (#7597) - I broke this in #7577 `pull_request` workflows don't have permission to comment, so we have to do this via a `pull_request_target` workflow. The point of this early comment is that the kitdiff link appears as soon as possible and isn't dependent on the preview build suceeding. --- .github/workflows/preview_build.yml | 14 -------------- .github/workflows/preview_comment.yml | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/preview_comment.yml diff --git a/.github/workflows/preview_build.yml b/.github/workflows/preview_build.yml index 4d644735..fe37eb8c 100644 --- a/.github/workflows/preview_build.yml +++ b/.github/workflows/preview_build.yml @@ -17,20 +17,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - - name: Comment PR - uses: thollander/actions-comment-pull-request@v2 - env: - URL_SLUG: ${{ github.event.number }}-${{ github.head_ref }} - with: - message: | - Preview is being built... - - Preview will be available at https://egui-pr-preview.github.io/pr/${{ env.URL_SLUG }} - - View snapshot changes at [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{ github.event.pull_request.html_url }}) - comment_tag: 'egui-preview' - - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: diff --git a/.github/workflows/preview_comment.yml b/.github/workflows/preview_comment.yml new file mode 100644 index 00000000..0334e0c2 --- /dev/null +++ b/.github/workflows/preview_comment.yml @@ -0,0 +1,23 @@ +name: preview_comment.yml +on: + pull_request_target: + types: [opened] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 + env: + URL_SLUG: ${{ github.event.number }}-${{ github.head_ref }} + with: + message: | + Preview is being built... + + Preview will be available at https://egui-pr-preview.github.io/pr/${{ env.URL_SLUG }} + + View snapshot changes at [kitdiff](https://rerun-io.github.io/kitdiff/?url=${{ github.event.pull_request.html_url }}) + comment_tag: 'egui-preview' +