签到 #23
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: 签到 | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '10 17 * * *' | |
| permissions: | |
| contents: read | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: 检出仓库 | |
| uses: actions/checkout@v4 | |
| - name: 创建 Node 环境 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: 'npm' | |
| cache-dependency-path: ./api/package-lock.json | |
| - name: 检查 GitHub CLI | |
| run: | | |
| if ! command -v gh >/dev/null 2>&1; then | |
| curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | |
| sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg | |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
| sudo apt update | |
| sudo apt install gh -y | |
| fi | |
| gh --version | |
| - name: 缓存依赖 | |
| id: cache-npm | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./api/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('./api/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: 安装依赖 | |
| run: npm run install | |
| if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
| - name: 执行签到 | |
| run: npm run main | |
| env: | |
| USERINFO: ${{ secrets.USERINFO }} | |
| PAT: ${{ secrets.PAT }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| # 通知渠道(按需配置,全部可选) | |
| WECOM_BOT_KEY: ${{ secrets.WECOM_BOT_KEY }} | |
| DINGTALK_BOT_KEY: ${{ secrets.DINGTALK_BOT_KEY }} | |
| DINGTALK_SECRET: ${{ secrets.DINGTALK_SECRET }} | |
| FEISHU_BOT_KEY: ${{ secrets.FEISHU_BOT_KEY }} | |
| YUNHU_BOT_KEY: ${{ secrets.YUNHU_BOT_KEY }} | |
| SERVERCHAN_SENDKEY: ${{ secrets.SERVERCHAN_SENDKEY }} | |
| PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }} | |
| PUSHPLUS_TOPIC: ${{ secrets.PUSHPLUS_TOPIC }} | |
| TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }} | |
| TG_CHAT_ID: ${{ secrets.TG_CHAT_ID }} | |
| BARK_KEY: ${{ secrets.BARK_KEY }} | |
| BARK_GROUP: ${{ secrets.BARK_GROUP }} | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| MAIL_HOST: ${{ secrets.MAIL_HOST }} | |
| MAIL_PORT: ${{ secrets.MAIL_PORT }} | |
| MAIL_USER: ${{ secrets.MAIL_USER }} | |
| MAIL_PASS: ${{ secrets.MAIL_PASS }} | |
| MAIL_TO: ${{ secrets.MAIL_TO }} |