【样式】:优化移动端体验 #33
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: `[GitHub Actions]✅有新的提交: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}` | |
| } | |
| }; | |
| 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); | |
| } |