Pearcleaner:强大而轻量的 macOS 应用卸载与清理工具 #527
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: Create RSS | |
| on: | |
| issues: | |
| types: [labeled] | |
| jobs: | |
| create-rss: | |
| if: github.repository == 'jaywcjlove/quick-rss' && github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'weekly') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get the label modifier | |
| id: get_modifier # 设置一个 ID,用于后续步骤引用 | |
| run: | | |
| MODIFIER=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/events" \ | |
| | jq -r '[.[] | select(.event == "labeled" and .label.name == "weekly")] | last | .actor.login') | |
| echo "Label modifier: $MODIFIER" | |
| # 将修改者 login 写入环境变量 | |
| echo "MODIFIER=$MODIFIER" >> $GITHUB_ENV | |
| echo "modifier=$MODIFIER" >> "$GITHUB_OUTPUT" | |
| - name: Debug modifier output | |
| run: | | |
| echo "Modifier output is: ${{ steps.get_modifier.outputs.modifier }}" | |
| - uses: actions/checkout@v4 | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| - uses: actions/setup-node@v4 | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| with: | |
| node-version: 20 | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm install | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| - name: Create RSS | |
| run: node .github/scripts/create-rss.mjs | |
| # 判断是不是仓库作者更新的 label,并且判断是否包含 weekly | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| env: | |
| ISSUE_BODY: ${{ github.event.issue.body }} | |
| ISSUE_LINK: ${{ github.event.issue.html_url }} | |
| ISSUE_TITLE: ${{ github.event.issue.title }} | |
| ISSUE_ID: ${{ github.event.issue.number }} | |
| ISSUE_DATE: ${{ github.event.issue.created_at }} | |
| ISSUE_AUTHOR: ${{ github.event.issue.user.login }} | |
| ISSUE_AVATAR: ${{ github.event.issue.user.avatar_url }} | |
| - name: Commit changes | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| env: | |
| ISSUE_ID: ${{ github.event.issue.number }} | |
| ISSUE_TITLE: ${{ github.event.issue.title }} | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| # 获取当前分支名称 | |
| CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/}) | |
| git add . | |
| git commit -m "Quick RSS Feed: $ISSUE_TITLE #$ISSUE_ID" -m "https://wangchujiang.com/quick-rss/issue/$ISSUE_ID.html" | |
| git push origin $CURRENT_BRANCH | |
| - name: Comment on Issue | |
| uses: actions/github-script@v7 | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| env: | |
| ISSUE_ID: ${{ github.event.issue.number }} | |
| ISSUE_TITLE: ${{ github.event.issue.title }} | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| const issue_number = process.env.ISSUE_ID; | |
| const issue_title = process.env.ISSUE_TITLE; | |
| const owner = 'jaywcjlove'; | |
| const repo = 'quick-rss'; | |
| const comment_body = `🚀 自动发布完成!请查看:[${issue_title}](https://wangchujiang.com/quick-rss/issue/${issue_number}.html) 🎉`; | |
| await github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number, | |
| body: comment_body | |
| }); | |
| - name: Trigger Deploy | |
| uses: actions/github-script@v7 | |
| if: steps.get_modifier.outputs.modifier == 'jaywcjlove' | |
| with: | |
| script: | | |
| const res = await github.rest.repos.createDispatchEvent({ | |
| owner: 'jaywcjlove', | |
| repo: 'quick-rss', | |
| event_type: 'run-deploy' | |
| }); | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |