Skip to content

Commit e16dc51

Browse files
authored
refactor: github workflows (#2)
1 parent c422f39 commit e16dc51

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.github/workflows/ci-unit-tests.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
name: Unit tests
22

3-
on: [pull_request, push]
3+
on: pull_request
4+
5+
env:
6+
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47

58
jobs:
69
ci-unit-tests:
7-
permissions:
8-
contents: read
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: actions/checkout@v4
1213
- uses: actions/setup-node@v4
1314
with:
1415
# This should match the using value in `actions.yaml`
1516
node-version: 20
17+
registry-url: 'https://npm.pkg.github.com'
18+
scope: '@fond-of'
1619
- run: npm ci
1720
- run: npm run lint
18-
- run: npm run test

.github/workflows/publish.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published, edited]
66

7+
env:
8+
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9+
710
jobs:
811
publish:
912
runs-on: ubuntu-latest
@@ -16,6 +19,8 @@ jobs:
1619
uses: actions/setup-node@v4
1720
with:
1821
node-version: 20
22+
registry-url: 'https://npm.pkg.github.com'
23+
scope: '@fond-of'
1924
- name: NPM Install
2025
run: npm ci
2126
- name: Check Format
@@ -26,6 +31,6 @@ jobs:
2631
run: npm run build
2732
- uses: JasonEtco/build-and-tag-action@v2
2833
env:
29-
GITHUB_TOKEN: ${{ github.token }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3035
with:
3136
tag_name: ${{ github.event.release.tag_name }}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "Execute CodeBuild::startBuild for the current repo.",
55
"main": "dist/index.js",
66
"scripts": {
7-
"lint": "prettier -c *.js *.json *.md test/*.js; eslint **.js test/**.js",
8-
"format": "prettier --write -c *.js *.json *.md test/*.js; eslint --fix **.js test/**.js",
9-
"format:check": "prettier --check -c *.js *.json *.md test/*.js; eslint --fix **.js test/**.js",
7+
"lint": "prettier -c *.js *.json *.md; eslint **.js",
8+
"format": "prettier --write -c *.js *.json *.md; eslint --fix **.js",
9+
"format:check": "prettier --check -c *.js *.json *.md; eslint --fix **.js",
1010
"package": "ncc build index.js -o dist",
1111
"build": "ncc build index.js -o dist"
1212
},

0 commit comments

Comments
 (0)