chore: update auto label

This commit is contained in:
Tony 2025-06-05 21:07:25 +08:00
parent e10c3a51ee
commit ef22a71dd6
7 changed files with 21 additions and 16 deletions

2
.github/labeler.yml vendored
View File

@ -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']

View File

@ -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}}'

View File

@ -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)

View File

@ -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

View File

@ -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([]);

View File

@ -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) {

View File

@ -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 class="message">)(.+?)(?=<\/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);