Skip to content

Commit cfd570a

Browse files
committed
chore: 🤖 fix cspell husky order and add demo github actions
1 parent 2ee0fdb commit cfd570a

File tree

5 files changed

+73
-5
lines changed

5 files changed

+73
-5
lines changed

.cspell.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ignoreWords": ["tensorflow", "tfjs", "commitlint"],
2+
"ignoreWords": ["tensorflow", "tfjs", "commitlint", "noreply"],
33
"ignorePaths": [
44
"**/package-lock.json",
55
"**/node_modules/**",

.github/workflows/check-upstream.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Check upstream
2+
3+
on:
4+
schedule:
5+
- cron: '0/5 * * * *'
6+
7+
jobs:
8+
timestamp:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
# https://stackoverflow.com/a/58393457
14+
with:
15+
token: ${{ secrets.PAT }}
16+
17+
- name: List files after checkout
18+
run: |
19+
pwd
20+
ls -a
21+
22+
- name: Create timestamp
23+
run: |
24+
touch timestamp.txt
25+
date +%c >> timestamp.txt
26+
27+
- name: Commit and push to github
28+
# https://github.community/t/github-actions-bot-email-address/17204/5
29+
run: |
30+
git config user.name github-actions
31+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
32+
git add -A
33+
git-cz --non-interactive --type=ci --subject="ci testing with timestamp.txt"
34+
git push

.github/workflows/main-push.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#example-using-multiple-events-with-activity-types-or-configuration
2+
3+
on:
4+
# Trigger the workflow on push or pull request,
5+
# but only for the main branch
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
echo:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: List files after checkout
18+
run: |
19+
pwd
20+
ls -a
21+
cat timestamp.txt

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# tfjs-node-lambda
2+
3+
## Why
4+
5+
## Installation
6+
7+
## Contributing
8+
9+
We welcome contributions!
10+
11+
### Committing
12+
13+
We use husky git hooks to automate commitizen. Due to this [issue](https://github.com/commitizen/cz-cli/issues/558), we recommend running `git commit -m "any or empty message"` and following the interactive mode. Thank you!

husky.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const tasks = (t) => t.join(' && ');
22

33
module.exports = {
44
hooks: {
5-
'pre-commit': 'lint-staged',
6-
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
7-
'prepare-commit-msg': tasks([
8-
'exec < /dev/tty && git cz --hook || true',
5+
'pre-commit': tasks([
6+
'lint-staged',
97
'npx cspell -- --no-summary $(git diff --cached --name-only)',
108
]),
9+
'prepare-commit-msg': 'exec < /dev/tty && git cz --hook || true',
10+
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
1111
},
1212
};

0 commit comments

Comments
 (0)