Download Music 下载音乐 #159
This file contains 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: Download Music | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
initial-response: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- name: Initial Response | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
body: '🤖 GitHub Action 已接收到您的请求,正在处理中...\nRequest received, processing...' | |
}); | |
download: | |
needs: initial-response | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # 用于创建 releases | |
issues: write # 用于更新 issues | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build project | |
run: pnpm run build | |
- name: Parse issue and download music | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: node .github/scripts/process-issue.js |