v2.3.10b #9
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: Main Workflow | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| send_notification: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Notification | |
| uses: actions/github-script@v7 | |
| env: | |
| FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }} | |
| with: | |
| script: | | |
| if (!process.env.FEISHU_WEBHOOK_URL) { | |
| console.log('FEISHU_WEBHOOK_URL not set — skipping notification'); | |
| return; | |
| } | |
| const notification = { | |
| msg_type: 'text', | |
| content: { | |
| text: `There has been a push to the main branch. Check the details at: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}` | |
| } | |
| }; | |
| try { | |
| await fetch(process.env.FEISHU_WEBHOOK_URL, { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| body: JSON.stringify(notification) | |
| }); | |
| } catch (err) { | |
| console.log('Failed sending Feishu notification:', err.message || err); | |
| } |