@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
@@ -0,0 +1,382 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ workflow_dispatch: {}
8
+
9
+ permissions:
10
+ actions: read
11
+ checks: write
12
+ contents: read
13
+ statuses: write
14
+
15
+ jobs:
16
+ continuous-integration:
17
+ name: Continuous Integration
18
+ runs-on: ubuntu-latest
19
+
20
+ concurrency:
21
+ group: ${{ github.workflow }}-${{ github.ref }}
22
+ cancel-in-progress: true
23
+
24
+ steps:
25
+ - name: Checkout
26
+ id: checkout
27
+ uses: actions/checkout@v6
28
+
29
+ - name: Setup Node.js
30
+ id: setup-node
31
+ uses: actions/setup-node@v6
32
+ with:
33
+ node-version-file: .node-version
34
+ cache: npm
35
+
36
+ - name: Install Dependencies
37
+ id: install
38
+ run: npm ci
39
+
40
+ - name: Check Format
41
+ id: format
42
+ run: npm run format:check
43
+
44
+ - name: Lint
45
+ id: lint
46
+ run: npm run lint
47
+
48
+ - name: Test
49
+ id: test
50
+ run: npm run ci-test
51
+
52
+ typescript-esm-npm:
53
+ strategy:
54
+ matrix:
55
+ os:
56
+ - ubuntu-latest
57
+ - windows-latest
58
+
59
+ name: TypeScript ESM (npm)
60
+ runs-on: ${{ matrix.os }}
61
+
62
+ steps:
63
+ - name: Checkout @github/local-action
64
+ id: checkout
65
+ uses: actions/checkout@v6
66
+ with:
67
+ path: local-action
68
+
69
+ - name: Checkout TypeScript Template
70
+ id: checkout-typescript
71
+ uses: actions/checkout@v6
72
+ with:
73
+ path: typescript-action
74
+ repository: actions/typescript-action
75
+
76
+ - name: Setup Node.js
77
+ id: setup-node
78
+ uses: actions/setup-node@v6
79
+ with:
80
+ node-version-file: local-action/.node-version
81
+ cache: npm
82
+ cache-dependency-path: local-action/package-lock.json
83
+
84
+ - name: Install @github/local-action Dependencies
85
+ id: install
86
+ run: npm ci
87
+ working-directory: local-action
88
+
89
+ - name: Install TypeScript Template Dependencies
90
+ id: install-typescript
91
+ run: |
92
+ npm ci
93
+ npm uninstall @github/local-action
94
+ working-directory: typescript-action
95
+
96
+ - name: Link @github/local-action
97
+ id: link
98
+ run: npm link
99
+ working-directory: local-action
100
+
101
+ - name: Generate Dotenv File
102
+ id: dotenv
103
+ run: |
104
+ echo "ACTIONS_STEP_DEBUG=true" >> .env
105
+ echo "INPUT_MILLISECONDS=2400" >> .env
106
+ working-directory: typescript-action
107
+
108
+ - name: Test TypeScript Action
109
+ id: test
110
+ run: npm run local-action
111
+ working-directory: typescript-action
112
+
113
+ javascript-esm-npm:
114
+ strategy:
115
+ matrix:
116
+ os:
117
+ - ubuntu-latest
118
+ - windows-latest
119
+
120
+ name: JavaScript ESM (npm)
121
+ runs-on: ${{ matrix.os }}
122
+
123
+ steps:
124
+ - name: Checkout @github/local-action
125
+ id: checkout
126
+ uses: actions/checkout@v6
127
+ with:
128
+ path: local-action
129
+
130
+ - name: Checkout JavaScript Template
131
+ id: checkout-javascript
132
+ uses: actions/checkout@v6
133
+ with:
134
+ path: javascript-action
135
+ repository: actions/javascript-action
136
+
137
+ - name: Setup Node.js
138
+ id: setup-node
139
+ uses: actions/setup-node@v6
140
+ with:
141
+ node-version-file: local-action/.node-version
142
+ cache: npm
143
+ cache-dependency-path: local-action/package-lock.json
144
+
145
+ - name: Install @github/local-action Dependencies
146
+ id: install
147
+ run: npm ci
148
+ working-directory: local-action
149
+
150
+ - name: Install JavaScript Template Dependencies
151
+ id: install-javascript
152
+ run: |
153
+ npm ci
154
+ npm uninstall @github/local-action
155
+ working-directory: javascript-action
156
+
157
+ - name: Link @github/local-action
158
+ id: link
159
+ run: npm link
160
+ working-directory: local-action
161
+
162
+ - name: Generate Dotenv File
163
+ id: dotenv
164
+ run: |
165
+ echo "ACTIONS_STEP_DEBUG=true" >> .env
166
+ echo "INPUT_MILLISECONDS=2400" >> .env
167
+ working-directory: javascript-action
168
+
169
+ - name: Test JavaScript Action
170
+ id: test
171
+ run: npm run local-action
172
+ working-directory: javascript-action
173
+
174
+ typescript-esm-pnpm:
175
+ strategy:
176
+ matrix:
177
+ os:
178
+ - ubuntu-latest
179
+ - windows-latest
180
+
181
+ name: TypeScript ESM (pnpm)
182
+ runs-on: ${{ matrix.os }}
183
+
184
+ steps:
185
+ - name: Checkout @github/local-action
186
+ id: checkout
187
+ uses: actions/checkout@v6
188
+ with:
189
+ path: local-action
190
+
191
+ - name: Checkout TypeScript Template
192
+ id: checkout-typescript
193
+ uses: actions/checkout@v6
194
+ with:
195
+ path: typescript-pnpm-esm-action
196
+ repository: ncalteen/typescript-pnpm-esm-action
197
+
198
+ - name: Install pnpm
199
+ id: pnpm
200
+ uses: pnpm/action-setup@v4
201
+ with:
202
+ version: latest
203
+
204
+ - name: Setup Node.js
205
+ id: setup-node
206
+ uses: actions/setup-node@v6
207
+ with:
208
+ node-version-file: local-action/.node-version
209
+ cache: npm
210
+ cache-dependency-path: local-action/package-lock.json
211
+
212
+ - name: Install @github/local-action Dependencies
213
+ id: install
214
+ run: npm ci
215
+ working-directory: local-action
216
+
217
+ - name: Install TypeScript Template Dependencies
218
+ id: install-typescript
219
+ run: |
220
+ pnpm install
221
+ pnpm uninstall @github/local-action
222
+ working-directory: typescript-pnpm-esm-action
223
+
224
+ - name: Create Global Link
225
+ id: create-link
226
+ run: npm link
227
+ working-directory: local-action
228
+
229
+ - name: Use Global Link
230
+ id: use-link
231
+ run: pnpm link "${{ github.workspace }}/local-action"
232
+ working-directory: typescript-pnpm-esm-action
233
+
234
+ - name: Generate Dotenv File
235
+ id: dotenv
236
+ run: |
237
+ echo "ACTIONS_STEP_DEBUG=true" >> .env
238
+ echo "INPUT_MILLISECONDS=2400" >> .env
239
+ working-directory: typescript-pnpm-esm-action
240
+
241
+ - name: Test TypeScript Action
242
+ id: test
243
+ run: pnpm run local-action
244
+ working-directory: typescript-pnpm-esm-action
245
+
246
+ typescript-cjs-pnpm:
247
+ strategy:
248
+ matrix:
249
+ os:
250
+ - ubuntu-latest
251
+ - windows-latest
252
+
253
+ name: TypeScript CJS (pnpm)
254
+ runs-on: ${{ matrix.os }}
255
+
256
+ steps:
257
+ - name: Checkout @github/local-action
258
+ id: checkout
259
+ uses: actions/checkout@v6
260
+ with:
261
+ path: local-action
262
+
263
+ - name: Checkout TypeScript Template
264
+ id: checkout-typescript
265
+ uses: actions/checkout@v6
266
+ with:
267
+ path: typescript-pnpm-cjs-action
268
+ repository: ncalteen/typescript-pnpm-cjs-action
269
+
270
+ - name: Install pnpm
271
+ id: pnpm
272
+ uses: pnpm/action-setup@v4
273
+ with:
274
+ version: latest
275
+
276
+ - name: Setup Node.js
277
+ id: setup-node
278
+ uses: actions/setup-node@v6
279
+ with:
280
+ node-version-file: local-action/.node-version
281
+ cache: npm
282
+ cache-dependency-path: local-action/package-lock.json
283
+
284
+ - name: Install @github/local-action Dependencies
285
+ id: install
286
+ run: npm ci
287
+ working-directory: local-action
288
+
289
+ - name: Install TypeScript Template Dependencies
290
+ id: install-typescript
291
+ run: |
292
+ pnpm install
293
+ pnpm uninstall @github/local-action
294
+ working-directory: typescript-pnpm-cjs-action
295
+
296
+ - name: Create Global Link
297
+ id: create-link
298
+ run: npm link
299
+ working-directory: local-action
300
+
301
+ - name: Use Global Link
302
+ id: use-link
303
+ run: pnpm link "${{ github.workspace }}/local-action"
304
+ working-directory: typescript-pnpm-cjs-action
305
+
306
+ - name: Generate Dotenv File
307
+ id: dotenv
308
+ run: |
309
+ echo "ACTIONS_STEP_DEBUG=true" >> .env
310
+ echo "INPUT_MILLISECONDS=2400" >> .env
311
+ working-directory: typescript-pnpm-cjs-action
312
+
313
+ - name: Test TypeScript Action
314
+ id: test
315
+ run: pnpm run local-action
316
+ working-directory: typescript-pnpm-cjs-action
317
+
318
+ typescript-esm-yarn:
319
+ name: TypeScript ESM (yarn)
320
+ runs-on: ubuntu-latest
321
+
322
+ defaults:
323
+ run:
324
+ shell: bash
325
+ working-directory: local-action
326
+
327
+ steps:
328
+ - name: Checkout @github/local-action
329
+ id: checkout
330
+ uses: actions/checkout@v6
331
+ with:
332
+ path: local-action
333
+
334
+ - name: Checkout TypeScript Template
335
+ id: checkout-typescript
336
+ uses: actions/checkout@v6
337
+ with:
338
+ path: typescript-yarn-esm-action
339
+ repository: ncalteen/typescript-yarn-esm-action
340
+
341
+ - name: Setup Node.js
342
+ id: setup-node
343
+ uses: actions/setup-node@v6
344
+ with:
345
+ node-version-file: local-action/.node-version
346
+ cache: npm
347
+ cache-dependency-path: local-action/package-lock.json
348
+
349
+ - name: Install @github/local-action Dependencies
350
+ id: install
351
+ run: npm ci
352
+ working-directory: local-action
353
+
354
+ - name: Install TypeScript Template Dependencies
355
+ id: install-typescript
356
+ run: |
357
+ corepack enable
358
+ corepack prepare yarn@4.7.0 --activate
359
+ yarn install
360
+ working-directory: typescript-yarn-esm-action
361
+
362
+ - name: Create Global Link
363
+ id: create-link
364
+ run: npm link
365
+ working-directory: local-action
366
+
367
+ - name: Use Global Link
368
+ id: use-link
369
+ run: yarn link "${{ github.workspace }}/local-action"
370
+ working-directory: typescript-yarn-esm-action
371
+
372
+ - name: Generate Dotenv File
373
+ id: dotenv
374
+ run: |
375
+ echo "ACTIONS_STEP_DEBUG=true" >> .env
376
+ echo "INPUT_MILLISECONDS=2400" >> .env
377
+ working-directory: typescript-yarn-esm-action
378
+
379
+ - name: Test TypeScript Action
380
+ id: test
381
+ run: yarn run local-action
382
+ working-directory: typescript-yarn-esm-action
@@ -0,0 +1,47 @@
1
+ name: Lint Codebase
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: read
10
+ issues: write
11
+ packages: read
12
+ pull-requests: write
13
+ statuses: write
14
+
15
+ jobs:
16
+ lint:
17
+ name: Lint Codebase
18
+ runs-on: ubuntu-latest
19
+
20
+ concurrency:
21
+ group: ${{ github.workflow }}-${{ github.ref }}
22
+ cancel-in-progress: true
23
+
24
+ steps:
25
+ - name: Checkout
26
+ id: checkout
27
+ uses: actions/checkout@v6
28
+ with:
29
+ fetch-depth: 0
30
+
31
+ - name: Setup Node.js
32
+ id: setup-node
33
+ uses: actions/setup-node@v6
34
+ with:
35
+ node-version-file: .node-version
36
+ cache: npm
37
+
38
+ - name: Install Dependencies
39
+ id: install
40
+ run: npm ci
41
+
42
+ - name: Lint Codebase
43
+ id: lint-codebase
44
+ env:
45
+ DEFAULT_WORKSPACE: ${{ github.workspace }}
46
+ GITHUB_TOKEN: ${{ github.token }}
47
+ uses: oxsecurity/megalinter/flavors/cupcake@v9
@@ -0,0 +1,99 @@
1
+ name: 'Release'
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ concurrency:
9
+ group: ${{ github.workflow }}-${{ github.ref }}
10
+ cancel-in-progress: false
11
+
12
+ permissions: {}
13
+
14
+ jobs:
15
+ semVersie:
16
+ name: semVersie
17
+ runs-on: ubuntu-latest
18
+ permissions:
19
+ contents: read
20
+ outputs:
21
+ release: ${{ steps.semVersie.outputs.release }}
22
+ release-notes: ${{ steps.semVersie.outputs.release-notes }}
23
+ prerelease: ${{ steps.semVersie.outputs.prerelease }}
24
+ tag: ${{ steps.semVersie.outputs.tag }}
25
+ version: ${{ steps.semVersie.outputs.version }}
26
+ steps:
27
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28
+ with:
29
+ fetch-depth: 0
30
+ persist-credentials: false
31
+ - id: semVersie
32
+ name: semVersie
33
+ uses: RonaldPhilipsen/semVersie@41233349edfb40f4e6da4251fea7684026182dc9 # v2.3.4
34
+
35
+ release:
36
+ name: Create Release
37
+ needs: semVersie
38
+ runs-on: ubuntu-latest
39
+ permissions:
40
+ contents: write # to be able to push commits and create releases
41
+ packages: write # to be able to publish to GitHub Packages
42
+ id-token: write # to be able to use npm trusted publishing
43
+ if:
44
+ ${{ needs.semVersie.outputs.release == 'true' ||
45
+ needs.semVersie.outputs.prerelease == 'true' }}
46
+ env:
47
+ VERSION: ${{ needs.semVersie.outputs.version }}
48
+ TAG: ${{ needs.semVersie.outputs.tag }}
49
+ RELEASE_NOTES: ${{ needs.semVersie.outputs['release-notes'] }}
50
+ PRERELEASE: ${{ needs.semVersie.outputs.prerelease }}
51
+ steps:
52
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
53
+ with:
54
+ fetch-depth: 0
55
+ persist-credentials: false
56
+ - name: Install Node.js
57
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
58
+ timeout-minutes: 5
59
+ with:
60
+ node-version: '26'
61
+ registry-url: 'https://registry.npmjs.org'
62
+ - name: update version in package.json
63
+ run: |
64
+ npm version "$VERSION" --no-git-tag-version
65
+ - name: npm publish
66
+ run: npm publish
67
+ - name: publish to GitHub Packages
68
+ env:
69
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70
+ run: npm publish --registry https://npm.pkg.github.com
71
+ - name: Commit version bump
72
+ env:
73
+ GH_TOKEN: ${{ github.token }}
74
+ run: |
75
+ git config user.name 'github-actions[bot]'
76
+ git config user.email 'github-actions[bot]@users.noreply.github.com'
77
+ git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git
78
+ git switch -c "release-$VERSION"
79
+ git add package.json package-lock.json
80
+ git commit -m "chore: bump version to $VERSION"
81
+ git push --set-upstream origin "release-$VERSION"
82
+ - name: Tag Release
83
+ env:
84
+ GH_TOKEN: ${{ github.token }}
85
+ run: |
86
+ git tag "$TAG"
87
+ git push origin "$TAG"
88
+ - name: Create Release
89
+ env:
90
+ GH_TOKEN: ${{ github.token }}
91
+ run: |
92
+ gh release create "$TAG" \
93
+ --title "$TAG" \
94
+ --notes "$RELEASE_NOTES" \
95
+ $( [[ "$PRERELEASE" == 'true' ]] && echo '--prerelease' || echo '' )
96
+ - name: clean up branch
97
+ if: always()
98
+ run: |
99
+ git push origin --delete "release-$VERSION"
@@ -0,0 +1,44 @@
1
+ name: Version Check
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - bin/**/*
9
+ - src/**/*
10
+ - .node-version
11
+ - package-lock.json
12
+ - package.json
13
+ - tsconfig.base.json
14
+ - tsconfig.eslint.json
15
+ - tsconfig.json
16
+
17
+ permissions:
18
+ checks: write
19
+ contents: read
20
+ pull-requests: write
21
+
22
+ jobs:
23
+ check-version:
24
+ name: Version Check
25
+ runs-on: ubuntu-latest
26
+
27
+ if: ${{ startsWith(github.head_ref, 'dependabot/') == false }}
28
+
29
+ steps:
30
+ - name: Checkout
31
+ id: checkout
32
+ uses: actions/checkout@v6
33
+ with:
34
+ fetch-tags: true
35
+ fetch-depth: 0
36
+
37
+ - name: Check Version
38
+ id: check-version
39
+ uses: issue-ops/semver@v3
40
+ with:
41
+ check-only: true
42
+ comment: true
43
+ manifest-path: package.json
44
+ workspace: ${{ github.workspace }}