Skip to content

Commit d75f408

Browse files
committed
chore: 🤖 add custom github actions
1 parent 4053c3a commit d75f408

14 files changed

+1082
-951
lines changed

.cspell.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
{
2-
"ignoreWords": ["tensorflow", "tfjs", "commitlint", "noreply", "Brotli"],
2+
"ignoreWords": [
3+
"tensorflow",
4+
"tfjs",
5+
"commitlint",
6+
"noreply",
7+
"Brotli",
8+
"vercel"
9+
],
310
"ignorePaths": [
11+
"**/.cspell.json",
412
"**/package-lock.json",
13+
"**/.gitignore",
14+
"**/.prettierignore",
515
"**/node_modules/**",
16+
".github/actions/*/dist/**",
617
"**/vscode-extension/**",
718
"**/.git/**",
819
".vscode"

.github/actions/compile/action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Hello World'
2+
description: 'Greet someone and record the time'
3+
inputs:
4+
who-to-greet: # id of input
5+
description: 'Who to greet'
6+
required: true
7+
default: 'World'
8+
outputs:
9+
time: # id of output
10+
description: 'The time we greeted you'
11+
runs:
12+
using: 'node12'
13+
main: 'index.js'

.github/actions/compile/src/index.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import core from '@actions/core';
2+
import github from '@actions/github';
3+
4+
try {
5+
// `who-to-greet` input defined in action metadata file
6+
const nameToGreet = core.getInput('who-to-greet');
7+
console.log(`Hello ${nameToGreet}!`);
8+
const time = new Date().toTimeString();
9+
core.setOutput('time', time);
10+
// Get the JSON webhook payload for the event that triggered the workflow
11+
const payload = JSON.stringify(github.context.payload, undefined, 2);
12+
console.log(`The event payload: ${payload}`);
13+
} catch (error) {
14+
core.setFailed(error.message);
15+
}

.github/actions/matrix/action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Hello World'
2+
description: 'Greet someone and record the time'
3+
inputs:
4+
who-to-greet: # id of input
5+
description: 'Who to greet'
6+
required: true
7+
default: 'World'
8+
outputs:
9+
time: # id of output
10+
description: 'The time we greeted you'
11+
runs:
12+
using: 'node12'
13+
main: 'index.js'

.github/actions/matrix/dist/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/matrix/src/index.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import core from '@actions/core';
2+
import github from '@actions/github';
3+
4+
try {
5+
// `who-to-greet` input defined in action metadata file
6+
const nameToGreet = core.getInput('who-to-greet');
7+
console.log(`Hello ${nameToGreet}!`);
8+
const time = new Date().toTimeString();
9+
core.setOutput('time', time);
10+
// Get the JSON webhook payload for the event that triggered the workflow
11+
const payload = JSON.stringify(github.context.payload, undefined, 2);
12+
console.log(`The event payload: ${payload}`);
13+
} catch (error) {
14+
core.setFailed(error.message);
15+
}

.github/workflows/check-upstream.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check upstream
22

33
on:
44
# schedule:
5-
# - cron: '0/5 * * * *'
5+
# - cron: '0 0 * * *'
66
watch:
77
types: [started]
88

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Commented out dist for github actions
12

23
# Created by https://www.toptal.com/developers/gitignore/api/node,now,macos,windows,linux
34
# Edit at https://www.toptal.com/developers/gitignore?templates=node,now,macos,windows,linux
@@ -131,7 +132,7 @@ typings/
131132

132133
# Nuxt.js build / generate output
133134
.nuxt
134-
dist
135+
# dist
135136

136137
# Gatsby files
137138
.cache/

.prettierignore

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
package-lock.json
2+
3+
# Created by https://www.toptal.com/developers/gitignore/api/node,now,macos,windows,linux
4+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,now,macos,windows,linux
5+
6+
### Linux ###
7+
*~
8+
9+
# temporary files which can be created if a process still has a handle open of a deleted file
10+
.fuse_hidden*
11+
12+
# KDE directory preferences
13+
.directory
14+
15+
# Linux trash folder which might appear on any partition or disk
16+
.Trash-*
17+
18+
# .nfs files are created when an open file is removed but is still being accessed
19+
.nfs*
20+
21+
### macOS ###
22+
# General
23+
.DS_Store
24+
.AppleDouble
25+
.LSOverride
26+
27+
# Icon must end with two \r
28+
Icon
29+
30+
31+
# Thumbnails
32+
._*
33+
34+
# Files that might appear in the root of a volume
35+
.DocumentRevisions-V100
36+
.fseventsd
37+
.Spotlight-V100
38+
.TemporaryItems
39+
.Trashes
40+
.VolumeIcon.icns
41+
.com.apple.timemachine.donotpresent
42+
43+
# Directories potentially created on remote AFP share
44+
.AppleDB
45+
.AppleDesktop
46+
Network Trash Folder
47+
Temporary Items
48+
.apdisk
49+
50+
### Node ###
51+
# Logs
52+
logs
53+
*.log
54+
npm-debug.log*
55+
yarn-debug.log*
56+
yarn-error.log*
57+
lerna-debug.log*
58+
59+
# Diagnostic reports (https://nodejs.org/api/report.html)
60+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
61+
62+
# Runtime data
63+
pids
64+
*.pid
65+
*.seed
66+
*.pid.lock
67+
68+
# Directory for instrumented libs generated by jscoverage/JSCover
69+
lib-cov
70+
71+
# Coverage directory used by tools like istanbul
72+
coverage
73+
*.lcov
74+
75+
# nyc test coverage
76+
.nyc_output
77+
78+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
79+
.grunt
80+
81+
# Bower dependency directory (https://bower.io/)
82+
bower_components
83+
84+
# node-waf configuration
85+
.lock-wscript
86+
87+
# Compiled binary addons (https://nodejs.org/api/addons.html)
88+
build/Release
89+
90+
# Dependency directories
91+
node_modules/
92+
jspm_packages/
93+
94+
# TypeScript v1 declaration files
95+
typings/
96+
97+
# TypeScript cache
98+
*.tsbuildinfo
99+
100+
# Optional npm cache directory
101+
.npm
102+
103+
# Optional eslint cache
104+
.eslintcache
105+
106+
# Microbundle cache
107+
.rpt2_cache/
108+
.rts2_cache_cjs/
109+
.rts2_cache_es/
110+
.rts2_cache_umd/
111+
112+
# Optional REPL history
113+
.node_repl_history
114+
115+
# Output of 'npm pack'
116+
*.tgz
117+
118+
# Yarn Integrity file
119+
.yarn-integrity
120+
121+
# dotenv environment variables file
122+
.env
123+
.env.test
124+
.env*.local
125+
126+
# parcel-bundler cache (https://parceljs.org/)
127+
.cache
128+
.parcel-cache
129+
130+
# Next.js build output
131+
.next
132+
133+
# Nuxt.js build / generate output
134+
.nuxt
135+
dist
136+
137+
# Gatsby files
138+
.cache/
139+
# Comment in the public line in if your project uses Gatsby and not Next.js
140+
# https://nextjs.org/blog/next-9-1#public-directory-support
141+
# public
142+
143+
# vuepress build output
144+
.vuepress/dist
145+
146+
# Serverless directories
147+
.serverless/
148+
149+
# FuseBox cache
150+
.fusebox/
151+
152+
# DynamoDB Local files
153+
.dynamodb/
154+
155+
# TernJS port file
156+
.tern-port
157+
158+
# Stores VSCode versions used for testing VSCode extensions
159+
.vscode-test
160+
161+
### now ###
162+
.now
163+
.vercel
164+
165+
### Windows ###
166+
# Windows thumbnail cache files
167+
Thumbs.db
168+
Thumbs.db:encryptable
169+
ehthumbs.db
170+
ehthumbs_vista.db
171+
172+
# Dump file
173+
*.stackdump
174+
175+
# Folder config file
176+
[Dd]esktop.ini
177+
178+
# Recycle Bin used on file shares
179+
$RECYCLE.BIN/
180+
181+
# Windows Installer files
182+
*.cab
183+
*.msi
184+
*.msix
185+
*.msm
186+
*.msp
187+
188+
# Windows shortcuts
189+
*.lnk
190+
191+
# End of https://www.toptal.com/developers/gitignore/api/node,now,macos,windows,linux

lint-staged.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module.exports = {
22
'*.{js,jsx,ts,tsx,css,md,json}': 'prettier --write',
33
'package.json': 'sort-package-json',
4+
'.github/actions/matrix/**': () =>
5+
'npx @vercel/ncc build -m -C .github/actions/matrix/src/index.ts -o .github/actions/matrix/dist',
46
};

0 commit comments

Comments
 (0)