Skip to content

Commit d6a71e6

Browse files
committed
Bugfix - I first lowered case and then compared against Upper, oopsie! And I was also incrementing runs by 1 instead of by the actual amount of runs.
1 parent e8e423d commit d6a71e6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/gitxray/xrays/workflows_xray.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def run(gx_context, gx_output, gh_api):
3838
for actor, actor_runs in run_actors.items():
3939
percentage_runs = (actor_runs / total_runs) * 100
4040
if gx_context.isContributor(actor):
41-
run_contributors[actor] += 1
41+
run_contributors[actor] += actor_runs
4242
message = f"Contributor [{actor}] ran {actor_runs} [{percentage_runs:.2f}%] times workflow [{workflow.get('name')}] - See them at: [{repository.get('html_url')}/actions?query=actor%3A{actor}]"
4343
else:
44-
run_non_contributors[actor] += 1
44+
run_non_contributors[actor] += actor_runs
4545
message = f"{actor} is NOT a contributor and ran {actor_runs} [{percentage_runs:.2f}%] times workflow [{workflow.get('name')}] - See them at: [{repository.get('html_url')}/actions?query=actor%3A{actor}]"
4646

4747
gx_output.c_log(message, rtype="workflows", contributor=actor)
@@ -71,7 +71,7 @@ def run(gx_context, gx_output, gh_api):
7171
gx_output.r_log(f"WARNING: Workflow [{workflow.get('name')}] may be triggered by an event that might be misused by attackers. See more at https://gitxray.com/vulnerable_workflows", rtype="workflows")
7272

7373
#https://github.com/actions/toolkit/issues/641
74-
if "ACTIONS_ALLOW_UNSECURE_COMMANDS: true" in decoded_content: gx_output.r_log(f"WARNING: Workflow [{workflow.get('name')}] sets ACTIONS_ALLOW_UNSECURE_COMMANDS.", rtype="workflows")
74+
if "actions_allow_unsecure_commands: true" in decoded_content: gx_output.r_log(f"WARNING: Workflow [{workflow.get('name')}] sets ACTIONS_ALLOW_UNSECURE_COMMANDS.", rtype="workflows")
7575

7676
if "secrets." in decoded_content:
7777
secrets = re.findall(r"secrets\.[A-Za-z-_0-9]*", decoded_content)

0 commit comments

Comments
 (0)