File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,17 @@ inputs:
1717 description : " Control if you want forks count"
1818 required : False
1919 default : True
20+ project_sort_by :
21+ description : " Sorting the projects according to count of number of stars or forks"
22+ required : False
23+ default : ' stars'
2024
2125runs :
2226 using : " composite"
2327 steps :
2428 - run : python -m pip install PyGithub
2529 shell : bash
26- - run : python ${{ github.action_path }}/main-script.py ${{ inputs.gh_token }} ${{ inputs.file_name }} ${{ github.workspace }} ${{ inputs.max_repo_description }} ${{ inputs.allow_forks }}
30+ - run : python ${{ github.action_path }}/main-script.py ${{ inputs.gh_token }} ${{ inputs.file_name }} ${{ github.workspace }} ${{ inputs.max_repo_description }} ${{ inputs.allow_forks }} ${{ inputs.project_sort_by }}
2731 shell : bash
2832branding :
2933 icon : " award"
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ def rewriteContents(old_content, new_content):
1616start = git .rate_limiting [0 ]
1717max_repo_description = int (sys .argv [4 ])
1818allow_forks = bool (sys .argv [5 ])
19+ project_sort_by = sys .argv [6 ]
1920print (f'Request left at start of the script: { start } ' )
2021
2122user_object = git .get_user ()
@@ -51,8 +52,9 @@ def rewriteContents(old_content, new_content):
5152print (f'Requests Consumed in this process: { start - end } ' )
5253print ("=====================REPO CHECK ENDS=============================" )
5354
55+ sort_key = 'repo_' + project_sort_by
5456project_data_sorted = dict (
55- sorted (project_data .items (), key = lambda x : x [1 ]['repo_stars' ])[::- 1 ])
57+ sorted (project_data .items (), key = lambda x : x [1 ][sort_key ])[::- 1 ])
5658
5759
5860repoName = sys .argv [3 ].split ('/' )[- 1 ]
You can’t perform that action at this time.
0 commit comments