github.com/bytedance/gopkg@v0.0.0-20240514070511-01b2cbcf35e1/.github/workflows/feishu-notify.yml (about)

     1  name: Feishu Notification
     2  
     3  on:
     4    pull_request:
     5      types: [opened]
     6    issues:
     7      types: [opened]
     8  
     9  jobs:
    10    pr-opened:
    11      name: Pull Request Opened Notification
    12      if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
    13      runs-on: self-hosted
    14      steps:
    15        - name: Send Feishu Message
    16          env:
    17            ACTIONS_FEISHU_TAG: v1.3.1
    18            INPUT_WEBHOOK: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
    19            INPUT_MESSAGE_TYPE: post
    20            INPUT_TITLE: New Pull Request
    21            INPUT_CONTENT: |
    22              @${{ github.event.pull_request.user.login }} opened pull request #${{ github.event.pull_request.number }}:
    23  
    24                  ${{ github.event.pull_request.title }}
    25              
    26              See: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
    27  
    28          run: |
    29            sudo apt update
    30            sudo apt install wget -y
    31            wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz
    32            tar zxf linux-amd64-actions-feishu.tar.gz feishu
    33            ./feishu
    34  
    35    issues-opened:
    36      name: Issue Opened Notification
    37      if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
    38      runs-on: ubuntu-latest
    39      steps:
    40        - name: Send Feishu Message
    41          env:
    42            ACTIONS_FEISHU_TAG: v1.3.1
    43            INPUT_WEBHOOK: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
    44            INPUT_MESSAGE_TYPE: post
    45            INPUT_TITLE: New Issue
    46            INPUT_CONTENT: |
    47              @${{ github.event.issue.user.login }} opened issues #${{ github.event.issue.number }}:
    48  
    49                  ${{ github.event.issue.title }}
    50  
    51              See: https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}
    52  
    53          run: |
    54            sudo apt update
    55            sudo apt install wget -y
    56            wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz
    57            tar zxf linux-amd64-actions-feishu.tar.gz feishu
    58            ./feishu