fix(workflow): update Docker logs step to always run and add fail-build job

This commit is contained in:
Tony 2025-06-22 17:28:38 +08:00
parent a402d73ac6
commit 45ee587316
2 changed files with 28 additions and 2 deletions

View File

@ -115,5 +115,28 @@ jobs:
labels: 'auto: DO NOT merge'
- name: Print Docker container logs
if: (env.TEST_CONTINUE)
if: ${{ always() }}
run: docker logs rsshub # logs/combined.log? Not so readable...
fail-build:
name: Fail build
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
# https://github.com/orgs/community/discussions/25220
- name: Search the PR that triggered this workflow
uses: potiuk/get-workflow-origin@e2dae063368361e4cd1f510e8785cd73bca9352e # v1_5
id: source-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}
- name: Pull Request Labeler
uses: actions-cool/issues-helper@a610082f8ac0cf03e357eb8dd0d5e2ba075e017e # v3.6.0
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
labels: 'auto: DO NOT merge'

View File

@ -1,5 +1,8 @@
import jsBeautify from 'js-beautify';
const routeTestFailed = 'auto: not ready to review';
const readyToReview = 'auto: ready to review';
export default async function test({ github, context, core }, baseUrl, routes, number) {
if (routes[0] === 'NOROUTE') {
return;
@ -71,7 +74,7 @@ ${detail.slice(0, 65300 - routeFeedback.length)}
}
if (process.env.PULL_REQUEST) {
const resultLabel = failCount === links.length || successCount <= failCount ? 'auto: not ready to review' : 'auto: ready to review';
const resultLabel = failCount === links.length || successCount <= failCount ? routeTestFailed : readyToReview;
await github.rest.issues
.addLabels({
issue_number: number,