Auto update release notes from feishu #140
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
| name: Auto merge PR | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| auto-merge: | |
| if: contains(toJson(github.event.pull_request.labels.*.name), 'auto_merge') | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: 安装 GitHub CLI | |
| - name: Install github cli | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install gh -y | |
| # Step 2: 检出仓库代码 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| ref: master | |
| # Step 3: 检查 PR 标签并自动合并 | |
| - name: Auto merge pr | |
| run: | | |
| gh pr merge ${{ github.event.pull_request.number }} --auto --merge | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} | |
| notify-feishu-on-failure: | |
| runs-on: ubuntu-latest | |
| needs: auto-merge | |
| if: failure() | |
| steps: | |
| - name: Send notification to Feishu on failure | |
| run: | | |
| curl -X POST ${{ secrets.FEISHU_CI_BOT_WEBHOOK_URL }} \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{ | |
| "msg_type": "text", | |
| "content": { | |
| "text": "⚠️ GitHub Action 失败通知:自动合并 PR 时失败,请检查!\n- 仓库: ${{ github.repository }}\n- 分支: ${{ github.ref }}\n- 工作流: ${{ github.workflow }}\n- 触发人: ${{ github.actor }}\n- 查看日志: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| } | |
| }' |