File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 workflow_dispatch :
55 inputs :
66 pr_number :
7- description : ' Specific PR number to label (leave blank to scan PRs by state )'
7+ description : ' Specific PR number to label (leave blank to scan all PRs )'
88 required : false
99 type : string
10- pr_state :
11- description : ' State of PRs to scan (only used when PR number is blank)'
12- required : false
13- type : choice
14- options :
15- - open
16- - closed
17- - all
18- default : open
1910 dry_run :
2011 description : ' Dry run (only print proposed labels without applying them)'
2112 required : false
4233 const repo = context.repo.repo;
4334
4435 const prNumberInput = '${{ github.event.inputs.pr_number }}'.trim();
45- const prStateInput = '${{ github.event.inputs.pr_state }}' || 'open';
4636 const dryRun = ${{ github.event.inputs.dry_run || 'false' }};
4737
4838 // Define the 10 label types, colors, and descriptions
@@ -103,16 +93,16 @@ jobs:
10393 return;
10494 }
10595 } else {
106- console.log(` 🔍 Fetching PRs with state "${prStateInput}" in repository...` );
96+ console.log(' 🔍 Fetching all pull requests (open & closed/merged) in repository...' );
10797 try {
10898 const { data } = await github.rest.pulls.list({
10999 owner,
110100 repo,
111- state: prStateInput ,
101+ state: 'all' ,
112102 per_page: 100
113103 });
114104 prs = data;
115- console.log(` Found ${prs.length} PR(s) with state "${prStateInput}" to analyze.`);
105+ console.log(` Found ${prs.length} PR(s) to analyze.`);
116106 } catch (err) {
117107 core.setFailed(`Failed to fetch PRs: ${err.message}`);
118108 return;
You can’t perform that action at this time.
0 commit comments