Skip to content

Commit

Permalink
ci: Update issue workflows config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 24, 2024
1 parent e38b340 commit ea6310b
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ jobs:
if: github.repository == 'jaywcjlove/quick-rss' && github.event_name == 'issues' && contains(github.event.issue.labels.*.name, 'weekly')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- run: npm install

- name: Get the label modifier
run: |
MODIFIER=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
Expand All @@ -26,12 +18,23 @@ jobs:

# 将修改者 login 写入环境变量
echo "MODIFIER=$MODIFIER" >> $GITHUB_ENV

- uses: actions/checkout@v4
if: env.MODIFIER == 'jaywcjlove'

- uses: actions/setup-node@v4
if: env.MODIFIER == 'jaywcjlove'
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- run: npm install
if: env.MODIFIER == 'jaywcjlove'

- name: Create RSS
run: node .github/scripts/create-rss.mjs
# 判断是不是仓库作者更新的 label,并且判断是否包含 weekly
if: env.MODIFIER == 'jaywcjlove' && contains(github.event.issue.labels.*.name, 'weekly')
if: env.MODIFIER == 'jaywcjlove'
env:
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_LINK: ${{ github.event.issue.html_url }}
Expand All @@ -42,7 +45,7 @@ jobs:
ISSUE_AVATAR: ${{ github.event.issue.user.avatar_url }}

- name: Commit changes
if: env.MODIFIER == 'jaywcjlove' && contains(github.event.issue.labels.*.name, 'weekly')
if: env.MODIFIER == 'jaywcjlove'
env:
ISSUE_ID: ${{ github.event.issue.number }}
ISSUE_TITLE: ${{ github.event.issue.title }}
Expand All @@ -57,6 +60,7 @@ jobs:

- name: Trigger Deploy
uses: actions/github-script@v7
if: env.MODIFIER == 'jaywcjlove'
with:
script: |
const res = await github.rest.repos.createDispatchEvent({
Expand Down

0 comments on commit ea6310b

Please sign in to comment.