filter out plugins that are mounted #2087
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # this workflow is triggered by pull requests and will notify a google chat room about pull request events | |
| # | |
| # this workflow requires a secret "GCHAT_PR_ANNOUNCEMENTS_WEBHOOK" to point to the google chat room | |
| # if not declared his workflow will set a warning and will exit gracefully (=> without an error) | |
| # | |
| name: 'gchat-notify-pull-request' | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - closed | |
| - reopened | |
| - ready_for_review | |
| pull_request_review: | |
| types: | |
| - submitted | |
| issue_comment: | |
| types: | |
| - created | |
| jobs: | |
| send_notification: | |
| runs-on: ubuntu-latest | |
| name: Send message to gchat | |
| steps: | |
| - id: gchat_url | |
| run: | | |
| if [[ -z "${{ secrets.GCHAT_PR_ANNOUNCEMENTS_WEBHOOK }}" ]]; then | |
| echo "::warning::skip sending google chat pull request message : secret GCHAT_PR_ANNOUNCEMENTS_WEBHOOK is not defined" | |
| else | |
| # compute google chat url | |
| THREAD_KEY=$(echo '${{ github.event.pull_request.number || github.event.issue.number }}' | jq -sRr @uri) | |
| echo "GCHAT_URL=${{ secrets.GCHAT_PR_ANNOUNCEMENTS_WEBHOOK }}&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD&thread_key=$THREAD_KEY" \ | |
| >> $GITHUB_OUTPUT | |
| fi | |
| - name: send pr open/close message | |
| if: ${{ github.event_name == 'pull_request' && steps.gchat_url.outputs.GCHAT_URL }} | |
| run: | | |
| TEXT=$(cat -s <<'X!X' | jq -Rsr @json | |
| ${{ github.triggering_actor}} ${{ github.event.pull_request.merged == true && 'merged' || github.event.action}} pull request *'${{ github.event.pull_request.title }} ${{ github.event.pull_request.draft && '(draft)' || '' }}'* | |
| ${{ (github.event.action=='opened' || github.event.action=='edited') && github.event.pull_request.body || '' }} | |
| ${{ github.event.action=='opened' && github.event.pull_request._links.html.href || ''}} | |
| X!X | |
| ) | |
| curl -X POST \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"text\": $TEXT }" \ | |
| '${{ steps.gchat_url.outputs.GCHAT_URL }}' | |
| - name: send pr review | |
| if: ${{ github.event_name == 'pull_request_review' && steps.gchat_url.outputs.GCHAT_URL && (github.event.review.state == 'approved' || github.event.review.state == 'changes_requested') }} | |
| run: | | |
| TEXT=$(cat -s <<'X!X' | jq -Rsr @json | |
| ${{ github.triggering_actor }} ${{ github.event.action }} a review: ${{ github.event.review.state }} | |
| X!X | |
| ) | |
| curl -X POST \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"text\": $TEXT }" \ | |
| '${{ steps.gchat_url.outputs.GCHAT_URL }}' |