From cee4a1bcd1b96aebfe876d1aef698c422169a7d6 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 10 Sep 2023 14:25:05 +0000 Subject: [PATCH] CI: Comment when done [wheel build] --- .github/workflows/build_wheels.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 624e85916..468c51120 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -4,14 +4,14 @@ # https://github.com/airspeed-velocity/asv/blob/main/.github/workflows/wheels.yml # include [wheel build] in the commit to trigger wheel builds name: Build wheels -on: [push, pull_request, workflow_dispatch] +on: [push, workflow_dispatch, pull_request_target] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: - contents: read # to fetch code (actions/checkout) + contents: write # for the comment action jobs: get_commit_message: @@ -109,3 +109,20 @@ jobs: name: artifact path: dist - uses: pypa/gh-action-pypi-publish@release/v1 + + comment_on_pr: + if: >- + contains(needs.get_commit_message.outputs.message, '[wheel build]') || + github.event_name == pull_request_target' + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + steps: + - name: Comment PR + uses: thollander/actions-comment-pull-request@v1 + with: + message: | + Artifacts generated for this PR: + - [Wheels](${{ github.server_url }}/${{ github.repository }}/actions/artifacts/) + Please download and test these to validate the PR. + comment_includes: "Artifacts generated for this PR" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}