mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-03-13 10:30:18 +08:00
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
120 lines
3.5 KiB
YAML
120 lines
3.5 KiB
YAML
name: Issue Command
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
rebase:
|
|
name: Automatic Rebase
|
|
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.event.comment.author_association == 'COLLABORATOR'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
steps:
|
|
- name: Checkout the latest code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Automatic Rebase
|
|
uses: cirrus-actions/rebase@1.8
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.TOKEN_SUPER }}
|
|
|
|
self-assign:
|
|
name: Self Assign
|
|
if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, '/wip') }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
steps:
|
|
- uses: bdougie/take-action@v1.6.1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
trigger: '/wip'
|
|
|
|
test-on-demand:
|
|
name: Test route on demand
|
|
if: startsWith(github.event.comment.body, '/test')
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
|
|
- name: Use Node.js Active LTS
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies (pnpm)
|
|
run: pnpm i && pnpm rb
|
|
|
|
- name: Fetch affected routes
|
|
id: fetch-route
|
|
uses: actions/github-script@v7
|
|
env:
|
|
EVENT: ${{ toJson(github.event) }}
|
|
with:
|
|
script: |
|
|
const event = JSON.parse(process.env.EVENT)
|
|
const body = event.comment.body
|
|
const number = event.issue.number
|
|
const sender = event.comment.user.login
|
|
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/workflow/test-route/identify.js`)
|
|
return script({ github, context, core }, body, number, sender)
|
|
|
|
- name: Start RSSHub
|
|
if: env.TEST_CONTINUE
|
|
run: pnpm start &
|
|
env:
|
|
ALLOW_USER_HOTLINK_TEMPLATE: true
|
|
ALLOW_USER_SUPPLY_UNSAFE_DOMAIN: true
|
|
NODE_ENV: dev
|
|
LOGGER_LEVEL: debug
|
|
|
|
- name: Generate feedback
|
|
if: env.TEST_CONTINUE
|
|
uses: actions/github-script@v7
|
|
env:
|
|
TEST_BASEURL: http://localhost:1200
|
|
TEST_ROUTES: ${{ steps.fetch-route.outputs.result }}
|
|
EVENT: ${{ toJson(github.event) }}
|
|
with:
|
|
script: |
|
|
const event = JSON.parse(process.env.EVENT)
|
|
const link = process.env.TEST_BASEURL
|
|
const routes = JSON.parse(process.env.TEST_ROUTES)
|
|
const number = event.issue.number
|
|
core.info(`${link}, ${routes}, ${number}`)
|
|
const got = require("got")
|
|
const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/workflow/test-route/test.js`)
|
|
return script({ github, context, core, got }, link, routes, number)
|
|
|
|
- name: Print logs
|
|
if: (env.TEST_CONTINUE)
|
|
run: cat ${{ github.workspace }}/logs/combined.log
|
|
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: logs
|
|
path: logs
|
|
retention-days: 1
|