-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathaction.yml
More file actions
210 lines (183 loc) · 6.47 KB
/
Copy pathaction.yml
File metadata and controls
210 lines (183 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: "GitHub Dependents Info"
author: "Nicolas Vuillamy"
description: "Generates a markdown file with all repositories that have dependencies with the current GitHub repository package (s)"
inputs:
repo:
description: "Owner and name of the repository (example: nvuillam/node-sarif-builder)"
required: true
outputrepo:
description: "Owner and name of the output repository, if different from repo (example: nvuillam/node-sarif-builder)"
required: false
default: ""
markdownfile:
description: "Path and name of the output markdown file"
required: false
default: "docs/github-dependents-info.md"
badgemarkdownfile:
description: "Path and name of the file where to replace badges (example: README.md). Must contain tags <!-- gh-dependents-info-used-by-start --><!-- gh-dependents-info-used-by-end -->"
required: false
default: README.md
docurl:
description: "Custom URL to use for the badges hyperlink (defaults to generated markdown)"
required: false
default: ""
markdownbadgecolor:
description: "Color of the generated markdown badge"
required: false
default: informational
sort:
description: "Sort criteria: stars (default) or name"
required: false
default: stars
minstars:
description: "Minimum number of stars to appear in the results"
required: false
default: "0"
timedelay:
description: "Delay in seconds between GitHub requests"
required: false
default: "0.1"
csvdirectory:
description: "Directory path where CSV files should be written"
required: false
default: ""
mergepackages:
description: "If multiple packages, merge them into a single result when true"
required: false
default: "false"
json:
description: "Set to true to emit JSON output"
required: false
default: "false"
verbose:
description: "Set to true to enable verbose logging"
required: false
default: "false"
overwrite:
description: "Set to true to overwrite existing CSV progress files"
required: false
default: "false"
owner:
description: "Filter dependent repositories by owner (example: oxsecurity)"
required: false
default: ""
max-scraped-pages:
description: "Maximum number of pages to scrape per package (0 means no limit)"
required: false
default: "0"
pagination:
description: "Enable pagination to split results into multiple files"
required: false
default: "true"
page-size:
description: "Number of results per page when pagination is enabled"
required: false
default: "500"
llm-summary:
description: "Enable or disable AI usage summary generation when an LLM API key is present"
required: false
default: "true"
llm-model:
description: "LiteLLM model to use for the AI usage summary (example: gpt-4o-mini, gemini-3-flash-preview)"
required: false
default: ""
llm-max-repos:
description: "Max dependent repos included in the summary prompt payload"
required: false
default: "500"
llm-max-words:
description: "Max words for the generated summary"
required: false
default: "250"
llm-timeout:
description: "Timeout (seconds) for the summary LLM call"
required: false
default: "120"
runs:
using: "docker"
image: "docker://nvuillam/github-dependents-info:v4.0.0"
entrypoint: /bin/sh
args:
- -c
- |
set -euo pipefail
max_scraped_pages=$(printenv 'INPUT_MAX-SCRAPED-PAGES' 2>/dev/null || true)
page_size=$(printenv 'INPUT_PAGE-SIZE' 2>/dev/null || true)
llm_summary=$(printenv 'INPUT_LLM-SUMMARY' 2>/dev/null || true)
llm_model=$(printenv 'INPUT_LLM-MODEL' 2>/dev/null || true)
llm_max_repos=$(printenv 'INPUT_LLM-MAX-REPOS' 2>/dev/null || true)
llm_max_words=$(printenv 'INPUT_LLM-MAX-WORDS' 2>/dev/null || true)
llm_timeout=$(printenv 'INPUT_LLM-TIMEOUT' 2>/dev/null || true)
set -- github-dependents-info "--repo=${INPUT_REPO}"
if [ -n "${INPUT_OUTPUTREPO:-}" ]; then
set -- "$@" "--outputrepo=${INPUT_OUTPUTREPO}"
fi
if [ -n "${INPUT_MARKDOWNFILE:-}" ]; then
set -- "$@" "--markdownfile=${INPUT_MARKDOWNFILE}"
fi
if [ -n "${INPUT_BADGEMARKDOWNFILE:-}" ]; then
set -- "$@" "--badgemarkdownfile=${INPUT_BADGEMARKDOWNFILE}"
fi
if [ -n "${INPUT_DOCURL:-}" ]; then
set -- "$@" "--docurl=${INPUT_DOCURL}"
fi
if [ -n "${INPUT_MARKDOWNBADGECOLOR:-}" ]; then
set -- "$@" "--markdownbadgecolor=${INPUT_MARKDOWNBADGECOLOR}"
fi
if [ -n "${INPUT_SORT:-}" ]; then
set -- "$@" "--sort=${INPUT_SORT}"
fi
if [ -n "${INPUT_MINSTARS:-}" ]; then
set -- "$@" "--minstars=${INPUT_MINSTARS}"
fi
if [ -n "${INPUT_TIMEDELAY:-}" ]; then
set -- "$@" "--timedelay=${INPUT_TIMEDELAY}"
fi
if [ -n "${INPUT_CSVDIRECTORY:-}" ]; then
set -- "$@" "--csvdirectory=${INPUT_CSVDIRECTORY}"
fi
if [ -n "${INPUT_OWNER:-}" ]; then
set -- "$@" "--owner=${INPUT_OWNER}"
fi
if [ -n "$max_scraped_pages" ] && [ "$max_scraped_pages" != "0" ]; then
set -- "$@" "--max-scraped-pages=${max_scraped_pages}"
fi
if [ "${INPUT_PAGINATION:-true}" = "false" ]; then
set -- "$@" "--no-pagination"
fi
if [ -n "$page_size" ] && [ "$page_size" != "" ]; then
set -- "$@" "--page-size=${page_size}"
fi
if [ "${llm_summary:-true}" = "false" ]; then
set -- "$@" "--no-llm-summary"
elif [ "${llm_summary:-}" = "true" ]; then
set -- "$@" "--llm-summary"
fi
if [ -n "${llm_model:-}" ]; then
set -- "$@" "--llm-model=${llm_model}"
fi
if [ -n "${llm_max_repos:-}" ] && [ "${llm_max_repos}" != "" ]; then
set -- "$@" "--llm-max-repos=${llm_max_repos}"
fi
if [ -n "${llm_max_words:-}" ] && [ "${llm_max_words}" != "" ]; then
set -- "$@" "--llm-max-words=${llm_max_words}"
fi
if [ -n "${llm_timeout:-}" ] && [ "${llm_timeout}" != "" ]; then
set -- "$@" "--llm-timeout=${llm_timeout}"
fi
if [ "${INPUT_JSON:-false}" = "true" ]; then
set -- "$@" "--json"
fi
if [ "${INPUT_MERGEPACKAGES:-false}" = "true" ]; then
set -- "$@" "--mergepackages"
fi
if [ "${INPUT_VERBOSE:-false}" = "true" ]; then
set -- "$@" "--verbose"
fi
if [ "${INPUT_OVERWRITE:-false}" = "true" ]; then
set -- "$@" "--overwrite"
fi
exec "$@"
branding:
icon: "users"
color: "green"