@ronaldphilipsen/local-action 0.0.0-stage → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.checkov.yml +3 -0
  2. package/.env.example +379 -0
  3. package/.github/codeql/codeql-config.yml +7 -0
  4. package/.github/copilot-instructions.md +79 -0
  5. package/.github/dependabot.yml +32 -0
  6. package/.github/workflows/codeql-analysis.yml +53 -0
  7. package/.github/workflows/continuous-delivery.yml +93 -0
  8. package/.github/workflows/continuous-integration.yml +382 -0
  9. package/.github/workflows/linter.yml +47 -0
  10. package/.github/workflows/release.yaml +99 -0
  11. package/.github/workflows/version-check.yml +44 -0
  12. package/.grype.yml +151 -0
  13. package/.markdown-lint.yml +7 -0
  14. package/.mega-linter.yml +188 -0
  15. package/.node-version +1 -0
  16. package/.prettierignore +4 -0
  17. package/.prettierrc.yml +14 -0
  18. package/.vscode/launch.json +15 -0
  19. package/.vscode/mcp.json +9 -0
  20. package/.vscode/settings.json +15 -0
  21. package/.vscode/tasks.json +51 -0
  22. package/.yaml-lint.yml +10 -0
  23. package/CHANGELOG.md +75 -0
  24. package/CODEOWNERS +3 -0
  25. package/CODE_OF_CONDUCT.md +74 -0
  26. package/CONTRIBUTING.md +140 -0
  27. package/LICENSE +21 -0
  28. package/README.md +285 -2
  29. package/SECURITY.md +42 -0
  30. package/SUPPORT.md +19 -0
  31. package/__fixtures__/@actions/core.ts +14 -0
  32. package/__fixtures__/@actions/exec.ts +9 -0
  33. package/__fixtures__/@actions/github.ts +3 -0
  34. package/__fixtures__/@actions/http-client.ts +9 -0
  35. package/__fixtures__/@actions/io.ts +9 -0
  36. package/__fixtures__/@octokit/rest.ts +18 -0
  37. package/__fixtures__/crypto.ts +7 -0
  38. package/__fixtures__/fs.ts +27 -0
  39. package/__fixtures__/javascript/no-export/.env.fixture +2 -0
  40. package/__fixtures__/javascript/no-export/action.yml +16 -0
  41. package/__fixtures__/javascript/no-export/node_modules/.gitkeep +0 -0
  42. package/__fixtures__/javascript/no-export/package.json +12 -0
  43. package/__fixtures__/javascript/no-export/src/index.js +0 -0
  44. package/__fixtures__/javascript/no-export/src/main.js +0 -0
  45. package/__fixtures__/javascript/no-import/.env.fixture +2 -0
  46. package/__fixtures__/javascript/no-import/action.yml +16 -0
  47. package/__fixtures__/javascript/no-import/node_modules/.gitkeep +0 -0
  48. package/__fixtures__/javascript/no-import/package.json +12 -0
  49. package/__fixtures__/javascript/no-import/src/index.js +3 -0
  50. package/__fixtures__/javascript/no-import/src/main.js +7 -0
  51. package/__fixtures__/javascript/success/.env.fixture +2 -0
  52. package/__fixtures__/javascript/success/action.yml +16 -0
  53. package/__fixtures__/javascript/success/node_modules/.gitkeep +0 -0
  54. package/__fixtures__/javascript/success/package.json +12 -0
  55. package/__fixtures__/javascript/success/post/index.js +3 -0
  56. package/__fixtures__/javascript/success/post/main.js +13 -0
  57. package/__fixtures__/javascript/success/pre/index.js +3 -0
  58. package/__fixtures__/javascript/success/pre/main.js +13 -0
  59. package/__fixtures__/javascript/success/src/index.js +3 -0
  60. package/__fixtures__/javascript/success/src/main.js +13 -0
  61. package/__fixtures__/javascript-esm/no-import/.env.fixture +2 -0
  62. package/__fixtures__/javascript-esm/no-import/action.yml +16 -0
  63. package/__fixtures__/javascript-esm/no-import/node_modules/.gitkeep +0 -0
  64. package/__fixtures__/javascript-esm/no-import/package.json +13 -0
  65. package/__fixtures__/javascript-esm/no-import/src/index.js +3 -0
  66. package/__fixtures__/javascript-esm/no-import/src/main.js +7 -0
  67. package/__fixtures__/javascript-esm/success/.env.fixture +2 -0
  68. package/__fixtures__/javascript-esm/success/action.yml +16 -0
  69. package/__fixtures__/javascript-esm/success/node_modules/.gitkeep +0 -0
  70. package/__fixtures__/javascript-esm/success/package.json +13 -0
  71. package/__fixtures__/javascript-esm/success/post/index.js +3 -0
  72. package/__fixtures__/javascript-esm/success/post/main.js +13 -0
  73. package/__fixtures__/javascript-esm/success/pre/index.js +3 -0
  74. package/__fixtures__/javascript-esm/success/pre/main.js +13 -0
  75. package/__fixtures__/javascript-esm/success/src/index.js +3 -0
  76. package/__fixtures__/javascript-esm/success/src/main.js +13 -0
  77. package/__fixtures__/path.ts +7 -0
  78. package/__fixtures__/payloads/issue_opened.json +33 -0
  79. package/__fixtures__/stream/promises.ts +3 -0
  80. package/__fixtures__/tsconfig-paths.ts +4 -0
  81. package/__fixtures__/typescript/no-import/.env.fixture +2 -0
  82. package/__fixtures__/typescript/no-import/action.yml +16 -0
  83. package/__fixtures__/typescript/no-import/node_modules/.gitkeep +0 -0
  84. package/__fixtures__/typescript/no-import/package.json +15 -0
  85. package/__fixtures__/typescript/no-import/src/index.ts +3 -0
  86. package/__fixtures__/typescript/no-import/src/main.ts +3 -0
  87. package/__fixtures__/typescript/no-import/tsconfig.json +20 -0
  88. package/__fixtures__/typescript/success/.env.fixture +2 -0
  89. package/__fixtures__/typescript/success/action.yml +16 -0
  90. package/__fixtures__/typescript/success/node_modules/.gitkeep +0 -0
  91. package/__fixtures__/typescript/success/package.json +15 -0
  92. package/__fixtures__/typescript/success/post/index.ts +3 -0
  93. package/__fixtures__/typescript/success/post/main.ts +9 -0
  94. package/__fixtures__/typescript/success/pre/index.ts +3 -0
  95. package/__fixtures__/typescript/success/pre/main.ts +9 -0
  96. package/__fixtures__/typescript/success/src/index.ts +3 -0
  97. package/__fixtures__/typescript/success/src/main.ts +9 -0
  98. package/__fixtures__/typescript/success/tsconfig.json +20 -0
  99. package/__fixtures__/typescript/success-yaml/.env.fixture +2 -0
  100. package/__fixtures__/typescript/success-yaml/action.yaml +16 -0
  101. package/__fixtures__/typescript/success-yaml/node_modules/.gitkeep +0 -0
  102. package/__fixtures__/typescript/success-yaml/package.json +15 -0
  103. package/__fixtures__/typescript/success-yaml/post/index.ts +3 -0
  104. package/__fixtures__/typescript/success-yaml/post/main.ts +9 -0
  105. package/__fixtures__/typescript/success-yaml/pre/index.ts +3 -0
  106. package/__fixtures__/typescript/success-yaml/pre/main.ts +9 -0
  107. package/__fixtures__/typescript/success-yaml/src/index.ts +3 -0
  108. package/__fixtures__/typescript/success-yaml/src/main.ts +9 -0
  109. package/__fixtures__/typescript/success-yaml/tsconfig.json +20 -0
  110. package/__fixtures__/typescript-esm/no-export/.env.fixture +2 -0
  111. package/__fixtures__/typescript-esm/no-export/action.yml +17 -0
  112. package/__fixtures__/typescript-esm/no-export/node_modules/.gitkeep +0 -0
  113. package/__fixtures__/typescript-esm/no-export/package.json +17 -0
  114. package/__fixtures__/typescript-esm/no-export/src/index.ts +0 -0
  115. package/__fixtures__/typescript-esm/no-export/src/main.ts +0 -0
  116. package/__fixtures__/typescript-esm/no-export/tsconfig.json +25 -0
  117. package/__fixtures__/typescript-esm/no-import/.env.fixture +2 -0
  118. package/__fixtures__/typescript-esm/no-import/action.yml +17 -0
  119. package/__fixtures__/typescript-esm/no-import/node_modules/.gitkeep +0 -0
  120. package/__fixtures__/typescript-esm/no-import/package.json +17 -0
  121. package/__fixtures__/typescript-esm/no-import/src/index.ts +3 -0
  122. package/__fixtures__/typescript-esm/no-import/src/main.ts +3 -0
  123. package/__fixtures__/typescript-esm/no-import/tsconfig.json +25 -0
  124. package/__fixtures__/typescript-esm/success/.env.fixture +2 -0
  125. package/__fixtures__/typescript-esm/success/action.yml +17 -0
  126. package/__fixtures__/typescript-esm/success/node_modules/.gitkeep +0 -0
  127. package/__fixtures__/typescript-esm/success/package.json +17 -0
  128. package/__fixtures__/typescript-esm/success/post/index.ts +3 -0
  129. package/__fixtures__/typescript-esm/success/post/main.ts +9 -0
  130. package/__fixtures__/typescript-esm/success/pre/index.ts +3 -0
  131. package/__fixtures__/typescript-esm/success/pre/main.ts +9 -0
  132. package/__fixtures__/typescript-esm/success/src/index.ts +3 -0
  133. package/__fixtures__/typescript-esm/success/src/main.ts +9 -0
  134. package/__fixtures__/typescript-esm/success/tsconfig.json +25 -0
  135. package/__fixtures__/typescript-esm/tsconfig-comments/.env.fixture +2 -0
  136. package/__fixtures__/typescript-esm/tsconfig-comments/action.yml +17 -0
  137. package/__fixtures__/typescript-esm/tsconfig-comments/node_modules/.gitkeep +0 -0
  138. package/__fixtures__/typescript-esm/tsconfig-comments/package.json +17 -0
  139. package/__fixtures__/typescript-esm/tsconfig-comments/src/index.ts +3 -0
  140. package/__fixtures__/typescript-esm/tsconfig-comments/src/main.ts +9 -0
  141. package/__fixtures__/typescript-esm/tsconfig-comments/tsconfig.json +21 -0
  142. package/__tests__/command.test.ts +224 -0
  143. package/__tests__/stubs/artifact/internal/client.test.ts +340 -0
  144. package/__tests__/stubs/artifact/internal/delete/delete-artifact.test.ts +152 -0
  145. package/__tests__/stubs/artifact/internal/download/download-artifact.test.ts +119 -0
  146. package/__tests__/stubs/artifact/internal/find/get-artifact.test.ts +237 -0
  147. package/__tests__/stubs/artifact/internal/find/list-artifacts.test.ts +218 -0
  148. package/__tests__/stubs/artifact/internal/find/retry-options.test.ts +54 -0
  149. package/__tests__/stubs/artifact/internal/shared/config.test.ts +91 -0
  150. package/__tests__/stubs/artifact/internal/shared/errors.test.ts +38 -0
  151. package/__tests__/stubs/artifact/internal/shared/user-agent.test.ts +22 -0
  152. package/__tests__/stubs/artifact/internal/upload/path-and-artifact-name-validation.test.ts +53 -0
  153. package/__tests__/stubs/artifact/internal/upload/upload-artifact.test.ts +126 -0
  154. package/__tests__/stubs/artifact/internal/upload/upload-zip-specification.test.ts +49 -0
  155. package/__tests__/stubs/cache/cache.test.ts +357 -0
  156. package/__tests__/stubs/cache/errors.test.ts +55 -0
  157. package/__tests__/stubs/cache/internal/cacheUtils.test.ts +109 -0
  158. package/__tests__/stubs/cache/internal/constants.test.ts +81 -0
  159. package/__tests__/stubs/cache/internal/tar.test.ts +129 -0
  160. package/__tests__/stubs/core/core.test.ts +760 -0
  161. package/__tests__/stubs/core/path-utils.test.ts +45 -0
  162. package/__tests__/stubs/core/platform.test.ts +89 -0
  163. package/__tests__/stubs/core/summary.test.ts +455 -0
  164. package/__tests__/stubs/env.test.ts +72 -0
  165. package/__tests__/stubs/github/context.test.ts +73 -0
  166. package/__tests__/stubs/github/github.test.ts +15 -0
  167. package/__tests__/stubs/github/internal/utils.test.ts +98 -0
  168. package/__tests__/stubs/github/utils.test.ts +16 -0
  169. package/__tests__/utils/config.test.ts +78 -0
  170. package/__tests__/utils/output.test.ts +32 -0
  171. package/__tests__/utils/package.test.ts +33 -0
  172. package/badges/coverage.svg +1 -0
  173. package/bin/local-action.js +121 -0
  174. package/docs/create-a-job-summary.md +32 -0
  175. package/docs/debugging-in-vscode.md +27 -0
  176. package/docs/img/job-summary.png +0 -0
  177. package/docs/supported-functionality.md +126 -0
  178. package/eslint.config.mjs +74 -0
  179. package/jest.config.ts +41 -0
  180. package/package.json +93 -4
  181. package/src/command.ts +171 -0
  182. package/src/commands/run.ts +616 -0
  183. package/src/index.ts +21 -0
  184. package/src/stubs/artifact/artifact.ts +17 -0
  185. package/src/stubs/artifact/internal/client.ts +400 -0
  186. package/src/stubs/artifact/internal/delete/delete-artifact.ts +126 -0
  187. package/src/stubs/artifact/internal/download/download-artifact.ts +309 -0
  188. package/src/stubs/artifact/internal/find/get-artifact.ts +135 -0
  189. package/src/stubs/artifact/internal/find/list-artifacts.ts +188 -0
  190. package/src/stubs/artifact/internal/find/retry-options.ts +57 -0
  191. package/src/stubs/artifact/internal/shared/config.ts +64 -0
  192. package/src/stubs/artifact/internal/shared/errors.ts +53 -0
  193. package/src/stubs/artifact/internal/shared/interfaces.ts +195 -0
  194. package/src/stubs/artifact/internal/shared/user-agent.ts +13 -0
  195. package/src/stubs/artifact/internal/upload/path-and-artifact-name-validation.ts +92 -0
  196. package/src/stubs/artifact/internal/upload/upload-artifact.ts +127 -0
  197. package/src/stubs/artifact/internal/upload/upload-zip-specification.ts +108 -0
  198. package/src/stubs/artifact/internal/upload/zip.ts +122 -0
  199. package/src/stubs/cache/cache.ts +334 -0
  200. package/src/stubs/cache/errors.ts +31 -0
  201. package/src/stubs/cache/interfaces.ts +4 -0
  202. package/src/stubs/cache/internal/cacheUtils.ts +207 -0
  203. package/src/stubs/cache/internal/constants.ts +45 -0
  204. package/src/stubs/cache/internal/tar.ts +374 -0
  205. package/src/stubs/cache/options.ts +91 -0
  206. package/src/stubs/core/core.ts +743 -0
  207. package/src/stubs/core/path-utils.ts +39 -0
  208. package/src/stubs/core/platform.ts +132 -0
  209. package/src/stubs/core/summary.ts +399 -0
  210. package/src/stubs/env.ts +40 -0
  211. package/src/stubs/github/context.ts +94 -0
  212. package/src/stubs/github/github.ts +29 -0
  213. package/src/stubs/github/interfaces.ts +52 -0
  214. package/src/stubs/github/internal/utils.ts +83 -0
  215. package/src/stubs/github/utils.ts +52 -0
  216. package/src/types/quibble.d.ts +5 -0
  217. package/src/types.ts +116 -0
  218. package/src/utils/config.ts +47 -0
  219. package/src/utils/output.ts +20 -0
  220. package/src/utils/package.ts +38 -0
  221. package/tsconfig.base.json +29 -0
  222. package/tsconfig.eslint.json +22 -0
  223. package/tsconfig.json +18 -0
package/.checkov.yml ADDED
@@ -0,0 +1,3 @@
1
+ quiet: true
2
+ skip-check:
3
+ - CKV2_GHA_1
package/.env.example ADDED
@@ -0,0 +1,379 @@
1
+ ################################################################################
2
+ # Do not commit your actual .env file to Git! This may contain secrets or #
3
+ # other sensitive information. #
4
+ ################################################################################
5
+
6
+ ################################################################################
7
+ # @github/local-action Variables #
8
+ ################################################################################
9
+
10
+ # Environment variables specific to the @github/local-action tool.
11
+
12
+ ######################################################################
13
+ # The path to a workspace that can be used by `@github/local-action` #
14
+ # during local testing. This will be used as the root directory for #
15
+ # any files created by your action, as well as any environment files #
16
+ # that are created automatically by `@github/local-action`. If you #
17
+ # try to interact with the `@actions/artifact` or `@actions/cache` #
18
+ # packages, this tool will throw an error if this is not set to a #
19
+ # valid path. #
20
+ ######################################################################
21
+ LOCAL_ACTION_WORKSPACE=""
22
+
23
+ ######################################################################
24
+ # Local path where any artifacts will be saved. Will throw an error #
25
+ # if the action attempts to use the `@actions/artifact` package #
26
+ # without setting this value first. #
27
+ ######################################################################
28
+ LOCAL_ACTION_ARTIFACT_PATH=""
29
+
30
+ ######################################################################
31
+ # Local path where any caches will be read or saved. Will throw an #
32
+ # error if the action attempts to use the `@actions/cache` package #
33
+ # without setting this value first. #
34
+ ######################################################################
35
+ LOCAL_ACTION_CACHE_PATH=""
36
+
37
+ ################################################################################
38
+ # GitHub Actions Inputs #
39
+ # #
40
+ # GitHub Actions inputs should follow `INPUT_<name>` format (all uppercase). #
41
+ # Hyphens should not be converted to underscores! If your `action.yml` file #
42
+ # contains default values for inputs, you do not need to set them here too. #
43
+ ################################################################################
44
+
45
+ INPUT_MILLISECONDS=2400
46
+
47
+ ################################################################################
48
+ # GitHub Actions Environment Variables #
49
+ ################################################################################
50
+
51
+ # The following variables are set for every run of a workflow and can be used in
52
+ # your action. The initial values in this file are the defaults set by GitHub
53
+ # Actions. You can override them to suit your needs.
54
+ #
55
+ # For more information, see:
56
+ # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
57
+
58
+ ######################################################################
59
+ # Sets the maximum number of artifacts that will be returned in a #
60
+ # single list operation. Defaults to 1000. #
61
+ ######################################################################
62
+ # ACTIONS_ARTIFACT_MAX_ARTIFACT_COUNT=1000
63
+
64
+ ######################################################################
65
+ # Enable/disable step debug logging. Default is normally `false`, #
66
+ # but it is set to `true` for local debugging purposes. #
67
+ ######################################################################
68
+ ACTIONS_STEP_DEBUG=true
69
+
70
+ ######################################################################
71
+ # Always set to `true`. #
72
+ ######################################################################
73
+ CI="true"
74
+
75
+ ######################################################################
76
+ # The name of the action currently running, or the id of a step. For #
77
+ # example, the second invocation of `actions/checkout` will be #
78
+ # `actionscheckout2`. #
79
+ ######################################################################
80
+ # GITHUB_ACTION=""
81
+
82
+ ######################################################################
83
+ # Only supported in composite actions. #
84
+ ######################################################################
85
+ # GITHUB_ACTION_PATH=""
86
+
87
+ ######################################################################
88
+ # For a step executing an action, this is the owner and repository #
89
+ # name of the action. For example, `actions/checkout`. #
90
+ ######################################################################
91
+ # GITHUB_ACTION_REPOSITORY=""
92
+
93
+ ######################################################################
94
+ # Always set to true when GitHub Actions is running the workflow. #
95
+ # You can use this variable to differentiate when tests are being #
96
+ # run locally or by GitHub Actions. #
97
+ ######################################################################
98
+ GITHUB_ACTIONS="true"
99
+
100
+ ######################################################################
101
+ # The name of the person or app that initiated the workflow. For #
102
+ # example, `octocat`. #
103
+ ######################################################################
104
+ # GITHUB_ACTOR=""
105
+
106
+ ######################################################################
107
+ # The account ID of the person or app that triggered the initial #
108
+ # workflow run. For example, `1234567`. Note that this is different #
109
+ # from the actor username. #
110
+ ######################################################################
111
+ # GITHUB_ACTOR_ID=""
112
+
113
+ ######################################################################
114
+ # Returns the API URL. For example: `https://api.github.com`. #
115
+ ######################################################################
116
+ GITHUB_API_URL="https://api.github.com"
117
+
118
+ ######################################################################
119
+ # The name of the base ref or target branch of the pull request in a #
120
+ # workflow run. This is only set when the event that triggers a #
121
+ # workflow run is either pull_request or pull_request_target. For #
122
+ # example, `main`. #
123
+ ######################################################################
124
+ # GITHUB_BASE_REF=""
125
+
126
+ ######################################################################
127
+ # The name of the event that triggered the workflow. For example, #
128
+ # `workflow_dispatch`. #
129
+ ######################################################################
130
+ # GITHUB_EVENT_NAME=""
131
+
132
+ ######################################################################
133
+ # The path to the file on the runner that contains the full event #
134
+ # webhook payload. For example, `/github/workflow/event.json`. #
135
+ ######################################################################
136
+ # GITHUB_EVENT_PATH=""
137
+
138
+ ######################################################################
139
+ # Returns the GraphQL API URL. For example: #
140
+ # `https://api.github.com/graphql`. #
141
+ ######################################################################
142
+ GITHUB_GRAPHQL_URL="https://api.github.com/graphql"
143
+
144
+ ######################################################################
145
+ # The head ref or source branch of the pull request in a workflow #
146
+ # run. This property is only set when the event that triggers a #
147
+ # workflow run is either pull_request or pull_request_target. For #
148
+ # example, `feature-branch-1`. #
149
+ ######################################################################
150
+ # GITHUB_HEAD_REF=""
151
+
152
+ ######################################################################
153
+ # The job_id of the current job. For example, `greeting_job`. #
154
+ ######################################################################
155
+ # GITHUB_JOB=""
156
+
157
+ ######################################################################
158
+ # The fully-formed ref of the branch or tag that triggered the #
159
+ # workflow run. For workflows triggered by push, this is the branch #
160
+ # or tag ref that was pushed. For workflows triggered by #
161
+ # pull_request, this is the pull request merge branch. For workflows #
162
+ # triggered by release, this is the release tag created. For other #
163
+ # triggers, this is the branch or tag ref that triggered the #
164
+ # workflow run. This is only set if a branch or tag is available for #
165
+ # the event type. The ref given is fully-formed, meaning that for #
166
+ # branches the format is refs/heads/<branch_name>. For pull requests #
167
+ # events except pull_request_target, it is #
168
+ # refs/pull/<pr_number>/merge. pull_request_target events have the #
169
+ # ref from the base branch. For tags it is refs/tags/<tag_name>. For #
170
+ # example, refs/heads/feature-branch-1. #
171
+ ######################################################################
172
+ # GITHUB_REF=""
173
+
174
+ ######################################################################
175
+ # The short ref name of the branch or tag that triggered the #
176
+ # workflow run. This value matches the branch or tag name shown on #
177
+ # GitHub. For example, `feature-branch-1`. For pull requests, the #
178
+ # format is `<pr_number>/merge`. #
179
+ ######################################################################
180
+ # GITHUB_REF_NAME=""
181
+
182
+ ######################################################################
183
+ # `true` if branch protections or rulesets are configured for the #
184
+ # ref that triggered the workflow run. #
185
+ ######################################################################
186
+ # GITHUB_REF_PROTECTED=""
187
+
188
+ ######################################################################
189
+ # The type of ref that triggered the workflow run. Valid values are #
190
+ # `branch` or `tag`. #
191
+ ######################################################################
192
+ # GITHUB_REF_TYPE=""
193
+
194
+ ######################################################################
195
+ # The owner and repository name. For example, `octocat/Hello-World`. #
196
+ ######################################################################
197
+ # GITHUB_REPOSITORY=""
198
+
199
+ ######################################################################
200
+ # The ID of the repository. For example, `123456789`. Note that this #
201
+ # is different from the repository name. #
202
+ ######################################################################
203
+ # GITHUB_REPOSITORY_ID=""
204
+
205
+ ######################################################################
206
+ # The repository owner's name. For example, `octocat`. #
207
+ ######################################################################
208
+ # GITHUB_REPOSITORY_OWNER=""
209
+
210
+ ######################################################################
211
+ # The repository owner's account ID. For example, `1234567`. Note #
212
+ # that this is different from the owner's name. #
213
+ ######################################################################
214
+ # GITHUB_REPOSITORY_OWNER_ID=""
215
+
216
+ ######################################################################
217
+ # The number of days that workflow run logs and artifacts are kept. #
218
+ # For example, 90. #
219
+ ######################################################################
220
+ GITHUB_RETENTION_DAYS="90"
221
+
222
+ ######################################################################
223
+ # A unique number for each attempt of a particular workflow run in a #
224
+ # repository. This number begins at `1` for the workflow run's first #
225
+ # attempt, and increments with each re-run. For example, `3`. #
226
+ ######################################################################
227
+ GITHUB_RUN_ATTEMPT="1"
228
+
229
+ ######################################################################
230
+ # A unique number for each workflow run within a repository. This #
231
+ # number does not change if you re-run the workflow run. For #
232
+ # example, `1658821493`. #
233
+ ######################################################################
234
+ # GITHUB_RUN_ID=""
235
+
236
+ ######################################################################
237
+ # A unique number for each run of a particular workflow in a #
238
+ # repository. This number begins at `1` for the workflow's first #
239
+ # run, and increments with each new run. This number does not #
240
+ # change if you re-run the workflow run. For example, `3`. #
241
+ ######################################################################
242
+ GITHUB_RUN_NUMBER="1"
243
+
244
+ ######################################################################
245
+ # The URL of the GitHub server. For example: `https://github.com`. #
246
+ ######################################################################
247
+ GITHUB_SERVER_URL="https://github.com"
248
+
249
+ ######################################################################
250
+ # The commit SHA that triggered the workflow. The value of this #
251
+ # commit SHA depends on the event that triggered the workflow. For #
252
+ # more information, see Events that trigger workflows. For example, #
253
+ # `ffac537e6cbbf934b08745a378932722df287a53`. #
254
+ ######################################################################
255
+ # GITHUB_SHA=""
256
+
257
+ ######################################################################
258
+ # The username of the user that initiated the workflow run. If the #
259
+ # workflow run is a re-run, this value may differ from #
260
+ # `github.actor`. Any workflow re-runs will use the privileges of #
261
+ # `github.actor`, even if the actor initiating the re-run #
262
+ # (`github.triggering_actor`) has different privileges. #
263
+ ######################################################################
264
+ # GITHUB_TRIGGERING_ACTOR=""
265
+
266
+ ######################################################################
267
+ # The name of the workflow. For example, `My test workflow``. If the #
268
+ # workflow file doesn't specify a name, the value of this variable #
269
+ # is the full path of the workflow file in the repository. #
270
+ ######################################################################
271
+ GITHUB_WORKFLOW="Local Action"
272
+
273
+ ######################################################################
274
+ # The ref path to the workflow. #
275
+ ######################################################################
276
+ # GITHUB_WORKFLOW_REF=""
277
+
278
+ ######################################################################
279
+ # The commit SHA for the workflow file. #
280
+ ######################################################################
281
+ # GITHUB_WORKFLOW_SHA=""
282
+
283
+ ######################################################################
284
+ # The default working directory on the runner for steps, and the #
285
+ # default location of your repository when using the checkout #
286
+ # action. For example, `/home/runner/work/my-repo-name/repo-name`. #
287
+ ######################################################################
288
+ # GITHUB_WORKSPACE=""
289
+
290
+ ######################################################################
291
+ # The architecture of the runner executing the job. Possible values #
292
+ # are `X86`, X6`4, `ARM`, or `ARM64`. #
293
+ ######################################################################
294
+ # RUNNER_ARCH=""
295
+
296
+ ######################################################################
297
+ # This is set only if debug logging is enabled, and always has the #
298
+ # value of 1. It can be useful as an indicator to enable additional #
299
+ # debugging or verbose logging in your own job steps. Default is #
300
+ # normally not set, but it is set to `1` for local debugging #
301
+ # purposes. #
302
+ ######################################################################
303
+ RUNNER_DEBUG="1"
304
+
305
+ ######################################################################
306
+ # The environment of the runner executing the job. Possible values #
307
+ # are: github-hosted for GitHub-hosted runners provided by GitHub, #
308
+ # and self-hosted for self-hosted runners configured by the #
309
+ # repository owner. #
310
+ ######################################################################
311
+ RUNNER_ENVIRONMENT="github-hosted"
312
+
313
+ ######################################################################
314
+ # The name of the runner executing the job. This name may not be #
315
+ # unique in a workflow run as runners at the repository and #
316
+ # organization levels could use the same name. For example, #
317
+ # `Hosted Agent`. #
318
+ ######################################################################
319
+ RUNNER_NAME="Local Action"
320
+
321
+ ######################################################################
322
+ # The operating system of the runner executing the job. Possible #
323
+ # values are `Linux`, `Windows`, or `macOS`. For example, `Windows`. #
324
+ ######################################################################
325
+ # RUNNER_OS=""
326
+
327
+ ######################################################################
328
+ # The path to a temporary directory on the runner. This directory is #
329
+ # emptied at the beginning and end of each job. Note that files will #
330
+ # not be removed if the runner's user account does not have #
331
+ # permission to delete them. For example, `D:\a\_temp`. #
332
+ ######################################################################
333
+ # RUNNER_TEMP=""
334
+
335
+ ######################################################################
336
+ # The path to the directory containing preinstalled tools for #
337
+ # GitHub-hosted runners. For more information, see Using #
338
+ # GitHub-hosted runners. For example, `C:\hostedtoolcache\windows`. #
339
+ ######################################################################
340
+ # RUNNER_TOOL_CACHE=""
341
+
342
+
343
+ ################################################################################
344
+ # GitHub Actions Environment Files #
345
+ # #
346
+ # The following variables point to specific files on the runner that are used #
347
+ # to set environment variables, outputs, and other information. These files #
348
+ # are created and managed by GitHub Actions. #
349
+ # #
350
+ # Currently these are not used by `@github/local-action`. #
351
+ ################################################################################
352
+
353
+ ######################################################################
354
+ # The path on the runner to the file that sets variables from #
355
+ # workflow commands. The path to this file is unique to the current #
356
+ # step and changes for each step in a job. #
357
+ ######################################################################
358
+ # GITHUB_ENV=""
359
+
360
+ ######################################################################
361
+ # The path on the runner to the file that sets the current step's #
362
+ # outputs from workflow commands. The path to this file is unique to #
363
+ # the current step and changes for each step in a job. #
364
+ ######################################################################
365
+ # GITHUB_OUTPUT=""
366
+
367
+ ######################################################################
368
+ # The path on the runner to the file that sets system `PATH` #
369
+ # variables from workflow commands. The path to this file is unique #
370
+ # to the current step and changes for each step in a job. #
371
+ ######################################################################
372
+ # GITHUB_PATH=""
373
+
374
+ ######################################################################
375
+ # The path on the runner to the file that contains job summaries #
376
+ # from workflow commands. The path to this file is unique to the #
377
+ # current step and changes for each step in a job. #
378
+ ######################################################################
379
+ # GITHUB_STEP_SUMMARY=""
@@ -0,0 +1,7 @@
1
+ name: JavaScript CodeQL Configuration
2
+
3
+ paths-ignore:
4
+ - coverage
5
+ - megalinter-reports
6
+ - node_modules
7
+ - reports
@@ -0,0 +1,79 @@
1
+ # Copilot Instructions
2
+
3
+ ## Environment Setup
4
+
5
+ Install dependencies by running:
6
+
7
+ ```bash
8
+ npm install
9
+ ```
10
+
11
+ ## Testing
12
+
13
+ Ensure all unit tests pass by running:
14
+
15
+ ```bash
16
+ npm run test
17
+ ```
18
+
19
+ Unit tests should exist in the `__tests__` directory. They are powered by
20
+ `jest`. Fixtures should be placed in the `__fixtures__` directory.
21
+
22
+ ## General Coding Guidelines
23
+
24
+ - Follow standard TypeScript and JavaScript coding conventions and best
25
+ practices
26
+ - Changes should maintain consistency with existing patterns and style
27
+ - Document changes clearly and thoroughly, including updates to existing
28
+ comments when appropriate
29
+ - Do not include basic, unnecessary comments that simply restate what the code
30
+ is doing (focus on explaining _why_, not _what_)
31
+ - Use consistent error handling patterns throughout the codebase
32
+ - Use TypeScript's type system to ensure type safety and clarity
33
+ - Keep functions focused and manageable
34
+ - Use descriptive variable and function names that clearly convey their purpose
35
+ - Use JSDoc comments to document functions, classes, and complex logic
36
+ - After doing any refactoring, ensure to run `npm run test` to ensure that all
37
+ tests still pass and coverage requirements are met
38
+ - When suggesting code changes, always opt for the most maintainable approach.
39
+ Try your best to keep the code clean and follow "Don't Repeat Yourself" (DRY)
40
+ principles
41
+ - Avoid unnecessary complexity and always consider the long-term maintainability
42
+ of the code
43
+ - When writing unit tests, try to consider edge cases as well as the main path
44
+ of success. This will help ensure that the code is robust and can handle
45
+ unexpected inputs or situations
46
+
47
+ ### Versioning
48
+
49
+ GitHub Actions are versioned using branch and tag names. Please ensure the
50
+ version in the project's `package.json` is updated to reflect the changes made
51
+ in the codebase. The version should follow
52
+ [Semantic Versioning](https://semver.org/) principles.
53
+
54
+ ## Pull Request Guidelines
55
+
56
+ When creating a pull request (PR), please ensure that:
57
+
58
+ - Keep changes focused and minimal (avoid large changes, or consider breaking
59
+ them into separate, smaller PRs)
60
+ - Formatting checks pass
61
+ - Linting checks pass
62
+ - Unit tests pass and coverage requirements are met
63
+ - If necessary, the `README.md` file is updated to reflect any changes in
64
+ functionality or usage
65
+
66
+ The body of the PR should include:
67
+
68
+ - A summary of the changes
69
+ - A special note of any changes to dependencies
70
+ - A link to any relevant issues or discussions
71
+ - Any additional context that may be helpful for reviewers
72
+
73
+ ## Code Review Guidelines
74
+
75
+ When performing a code review, please follow these guidelines:
76
+
77
+ - If there are changes that modify the functionality/usage of the action,
78
+ validate that there are changes in the `README.md` file that document the new
79
+ or modified functionality
@@ -0,0 +1,32 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ labels:
6
+ - dependabot
7
+ - actions
8
+ schedule:
9
+ interval: monthly
10
+ groups:
11
+ actions-minor:
12
+ update-types:
13
+ - minor
14
+ - patch
15
+
16
+ - package-ecosystem: npm
17
+ directory: /
18
+ labels:
19
+ - dependabot
20
+ - npm
21
+ schedule:
22
+ interval: monthly
23
+ groups:
24
+ npm-development:
25
+ dependency-type: development
26
+ update-types:
27
+ - minor
28
+ - patch
29
+ npm-production:
30
+ dependency-type: production
31
+ update-types:
32
+ - patch
@@ -0,0 +1,53 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+ schedule:
11
+ - cron: '31 7 * * 3'
12
+
13
+ permissions:
14
+ actions: read
15
+ checks: write
16
+ contents: read
17
+ security-events: write
18
+
19
+ jobs:
20
+ analyze:
21
+ name: Analyze
22
+ runs-on: ubuntu-latest
23
+
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ language:
28
+ - TypeScript
29
+
30
+ concurrency:
31
+ group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.language }}
32
+ cancel-in-progress: true
33
+
34
+ steps:
35
+ - name: Checkout
36
+ id: checkout
37
+ uses: actions/checkout@v6
38
+
39
+ - name: Initialize CodeQL
40
+ id: initialize
41
+ uses: github/codeql-action/init@v4
42
+ with:
43
+ languages: ${{ matrix.language }}
44
+ source-root: src
45
+ config-file: .github/codeql/codeql-config.yml
46
+
47
+ - name: Autobuild
48
+ id: autobuild
49
+ uses: github/codeql-action/autobuild@v4
50
+
51
+ - name: Perform CodeQL Analysis
52
+ id: analyze
53
+ uses: github/codeql-action/analyze@v4
@@ -0,0 +1,93 @@
1
+ name: Continuous Delivery
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - closed
7
+ branches:
8
+ - main
9
+ paths:
10
+ - bin/**/*
11
+ - src/**/*
12
+ - .node-version
13
+ - package-lock.json
14
+ - package.json
15
+ - tsconfig.base.json
16
+ - tsconfig.eslint.json
17
+ - tsconfig.json
18
+ workflow_dispatch:
19
+
20
+ permissions:
21
+ contents: write
22
+ id-token: write
23
+
24
+ jobs:
25
+ publish:
26
+ name: Publish to npm
27
+ runs-on: ubuntu-latest
28
+
29
+ # Only run this job if one of the following is true:
30
+ # - It was run manually.
31
+ # - A PR was merged that was not from Dependabot or a fork.
32
+ if: |
33
+ github.event_name == 'workflow_dispatch' ||
34
+ (
35
+ github.event.pull_request.merged == true &&
36
+ startsWith(github.head_ref, 'dependabot/') == false &&
37
+ github.event.pull_request.head.repo.fork == false
38
+ )
39
+
40
+ steps:
41
+ - name: Checkout
42
+ id: checkout
43
+ uses: actions/checkout@v6
44
+ with:
45
+ fetch-tags: true
46
+
47
+ - name: Setup Node.js
48
+ id: setup-node
49
+ uses: actions/setup-node@v6
50
+ with:
51
+ cache: npm
52
+ node-version-file: .node-version
53
+ registry-url: https://registry.npmjs.org/
54
+
55
+ - name: Install Dependencies
56
+ id: install
57
+ run: npm ci
58
+
59
+ - name: Test
60
+ id: test
61
+ run: npm run ci-test
62
+
63
+ - name: Publish
64
+ id: publish
65
+ run: |
66
+ npm publish --ignore-scripts --access public
67
+
68
+ release:
69
+ name: Create Release
70
+ runs-on: ubuntu-latest
71
+
72
+ needs: publish
73
+
74
+ steps:
75
+ - name: Checkout
76
+ id: checkout
77
+ uses: actions/checkout@v6
78
+ with:
79
+ fetch-tags: true
80
+
81
+ - name: Tag
82
+ id: tag
83
+ uses: issue-ops/semver@v3
84
+ with:
85
+ manifest-path: package.json
86
+ workspace: ${{ github.workspace }}
87
+ ref: main
88
+
89
+ - name: Create Release
90
+ id: release
91
+ uses: issue-ops/releaser@v3
92
+ with:
93
+ tag: v${{ steps.tag.outputs.version }}