Skip to content

Commit

Permalink
ci: add some naming to actions (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
thollander authored Apr 23, 2022
1 parent 696b330 commit 4ce6dd9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@ jobs:
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install
- run: npm run build
- run: npm run format
- uses: fregante/setup-git-user@v1
- if: github.event_name == 'push' && github.ref_name == 'main'
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Lint
run: npm run lint

- name: Setup Git
if: github.event_name == 'push' && github.ref_name == 'main'
uses: fregante/setup-git-user@v1

- name: Commit/push if there is a diff
if: github.event_name == 'push' && github.ref_name == 'main'
run: |
# commit only if there is a diff
if ! git diff --exit-code; then
git add .
git commit -m "chore: compile and lint $GITHUB_SHA [ci skip]"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/main.js",
"scripts": {
"build": "tsc",
"format": "prettier --write **/*.ts"
"lint": "prettier --write **/*.ts"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 4ce6dd9

Please sign in to comment.