diff --git a/.github/labeler.yml b/.github/labeler.yml index 583833314..522304257 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,4 @@ -'Route: deprecated': +'route: deprecated': - changed-files: - any-glob-to-any-file: ['lib/router.js'] - all-globs-to-any-file: ['lib/routes-deprecated/**/*.js', '!lib/routes-deprecated/index.js'] diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 02dc48f16..636f830c9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -52,7 +52,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -65,7 +65,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -78,6 +78,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12 + uses: github/codeql-action/analyze@v3 with: category: '/language:${{matrix.language}}' diff --git a/.github/workflows/docker-test-cont.yml b/.github/workflows/docker-test-cont.yml index c47ccaca7..f1244ad31 100644 --- a/.github/workflows/docker-test-cont.yml +++ b/.github/workflows/docker-test-cont.yml @@ -112,7 +112,7 @@ jobs: actions: 'add-labels' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }} - labels: 'Auto: Route Test Failed' + labels: 'auto: DO NOT merge' - name: Print Docker container logs if: (env.TEST_CONTINUE) diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml index 7d69b44ac..aa1b5ff18 100644 --- a/.github/workflows/docker-test.yml +++ b/.github/workflows/docker-test.yml @@ -59,7 +59,7 @@ jobs: actions: 'add-labels' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} - labels: 'Auto: Route Test Failed' + labels: 'auto: DO NOT merge' - name: Test Docker image run: bash scripts/docker/test-docker.sh diff --git a/scripts/workflow/test-issue/call-maintainer.mjs b/scripts/workflow/test-issue/call-maintainer.mjs index 76f8101c5..a9273ef75 100644 --- a/scripts/workflow/test-issue/call-maintainer.mjs +++ b/scripts/workflow/test-issue/call-maintainer.mjs @@ -4,11 +4,11 @@ import remarkParse from 'remark-parse'; // @TODO maybe we could use label or some other better ways to distinguish bug/feature issues const matchTitle = ['路由地址', 'Routes']; const maintainerURL = 'https://raw.githubusercontent.com/DIYgod/RSSHub/gh-pages/build/maintainers.json'; -const successTag = 'Bug Ping: Pinged'; -const parseFailTag = 'Bug Ping: Parsing Failed'; -const failTag = 'Bug Ping: Not Found'; -const deprecatedRoute = 'Route: deprecated'; -const route = 'Route'; +const successTag = 'bug ping: pinged'; +const parseFailTag = 'bug ping: parsing failed'; +const failTag = 'bug ping: not found'; +const deprecatedRoute = 'route: deprecated'; +const route = 'route'; // DnD (do-not-disturb) usernames, add yours here to avoid being notified const dndUsernames = new Set([]); diff --git a/scripts/workflow/test-route/identify.mjs b/scripts/workflow/test-route/identify.mjs index 01ffa6293..ae507cc1f 100644 --- a/scripts/workflow/test-route/identify.mjs +++ b/scripts/workflow/test-route/identify.mjs @@ -1,5 +1,5 @@ -const noFound = 'Auto: Route No Found'; -const testFailed = 'Auto: Route Test Failed'; +const noFound = 'auto: route no found'; +const testFailed = 'auto: DO NOT merge'; const allowedUser = new Set(['dependabot[bot]', 'pull[bot]']); // dependabot and downstream PR requested by pull[bot] export default async function identify({ github, context, core }, body, number, sender) { @@ -89,7 +89,7 @@ export default async function identify({ github, context, core }, body, number, if (allowedUser.has(sender)) { core.info('PR created by a allowed user, passing'); await removeLabel(); - await addLabels(['Auto: allowed']); + await addLabels(['auto: ready to merge']); return; } else { core.debug('PR created by ' + sender); @@ -102,7 +102,7 @@ export default async function identify({ github, context, core }, body, number, if (routes.length && routes[0] === 'NOROUTE') { core.info('PR stated no route, passing'); await removeLabel(); - await addLabels(['Auto: Route Test Skipped']); + await addLabels(['auto: route test bypassed']); return; } else if (routes.length) { diff --git a/scripts/workflow/test-route/test.mjs b/scripts/workflow/test-route/test.mjs index 58cb40345..f5fcf3f5d 100644 --- a/scripts/workflow/test-route/test.mjs +++ b/scripts/workflow/test-route/test.mjs @@ -11,6 +11,8 @@ export default async function test({ github, context, core }, baseUrl, routes, n }); let commentList = []; + let successCount = 0; + let failCount = 0; let comment = `Successfully [generated](${process.env.GITHUB_SERVER_URL}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) as following:\n`; for await (const lks of links) { @@ -23,8 +25,10 @@ export default async function test({ github, context, core }, baseUrl, routes, n const body = await res.text(); if (res.ok) { success = true; + successCount++; detail = jsBeautify.html(body.replaceAll(/\s+(\n|$)/g, '\n'), { indent_size: 2 }); } else { + failCount++; detail = `HTTPError: Response code ${res.status} (${res.statusText})`; const errInfoList = body && body.match(/(?<=

)(.+?)(?=<\/p>)/gs); if (errInfoList) { @@ -67,12 +71,13 @@ ${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'; await github.rest.issues .addLabels({ issue_number: number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['Auto: Route Test Complete'], + labels: [resultLabel], }) .catch((error) => { core.warning(error);