File tree 2 files changed +8
-2
lines changed 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,13 +17,17 @@ inputs:
17
17
description : " Control if you want forks count"
18
18
required : False
19
19
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'
20
24
21
25
runs :
22
26
using : " composite"
23
27
steps :
24
28
- run : python -m pip install PyGithub
25
29
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 }}
27
31
shell : bash
28
32
branding :
29
33
icon : " award"
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ def rewriteContents(old_content, new_content):
16
16
start = git .rate_limiting [0 ]
17
17
max_repo_description = int (sys .argv [4 ])
18
18
allow_forks = bool (sys .argv [5 ])
19
+ project_sort_by = sys .argv [6 ]
19
20
print (f'Request left at start of the script: { start } ' )
20
21
21
22
user_object = git .get_user ()
@@ -51,8 +52,9 @@ def rewriteContents(old_content, new_content):
51
52
print (f'Requests Consumed in this process: { start - end } ' )
52
53
print ("=====================REPO CHECK ENDS=============================" )
53
54
55
+ sort_key = 'repo_' + project_sort_by
54
56
project_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 ])
56
58
57
59
58
60
repoName = sys .argv [3 ].split ('/' )[- 1 ]
You can’t perform that action at this time.
0 commit comments