Skip to content

Commit 0ef3475

Browse files
Chrystiam Nascimento JuniorChrystiam Nascimento Junior
authored andcommitted
feat(configuration): adjust config
1 parent 1d8d16f commit 0ef3475

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

.github/actions/setup/action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
name: Setup
22
description: Setup Node.js and install dependencies
33

4+
inputs:
5+
GH_TOKEN:
6+
description: 'GH_TOKEN necessary to install dependencies'
7+
48
runs:
59
using: composite
610
steps:
11+
- name: Configure Git
12+
shell: sh
13+
run: |
14+
git config --global --add url."https://${{ inputs.GH_TOKEN }}@github.com/".insteadOf "https://github.com/"
15+
git config --global --add url."https://${{ inputs.GH_TOKEN }}@github.com/".insteadOf "git://github.com/"
16+
717
- name: Setup Node.js
8-
uses: actions/setup-node@v3
18+
uses: actions/setup-node@v4
919
with:
10-
node-version: 18 # Force Node.js 18 instead of using .nvmrc
20+
cache: yarn
21+
node-version-file: .nvmrc
22+
scope: '@lawnstarter'
1123

1224
- name: Cache dependencies
1325
id: yarn-cache

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
branches:
88
- main
99

10+
env:
11+
GH_TOKEN: ${{ secrets.GH_TOKEN_SEMANTIC_RELEASE || secrets.GITHUB_TOKEN || secrets.GH_TOKEN }}
12+
1013
jobs:
1114
lint:
1215
runs-on: ubuntu-latest
@@ -16,6 +19,8 @@ jobs:
1619

1720
- name: Setup project
1821
uses: ./.github/actions/setup
22+
with:
23+
GH_TOKEN: ${{ env.GH_TOKEN }}
1924

2025
- name: Lint files
2126
run: yarn lint
@@ -31,6 +36,8 @@ jobs:
3136

3237
- name: Setup project
3338
uses: ./.github/actions/setup
39+
with:
40+
GH_TOKEN: ${{ env.GH_TOKEN }}
3441

3542
- name: Run unit tests
3643
run: yarn test
@@ -43,6 +50,8 @@ jobs:
4350

4451
- name: Setup project
4552
uses: ./.github/actions/setup
53+
with:
54+
GH_TOKEN: ${{ env.GH_TOKEN }}
4655

4756
- name: Build package
4857
run: yarn prepack

.yarnrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# Override Yarn command so we can automatically setup the repo on running `yarn`
2+
npmRegistryServer: 'https://registry.npmjs.org/'
3+
4+
npmScopes:
5+
lawnstarter:
6+
npmAuthToken: '${GH_TOKEN}'
7+
npmRegistryServer: 'https://npm.pkg.github.com/'
28

39
yarn-path "scripts/bootstrap.js"

0 commit comments

Comments
 (0)