Skip to content

Commit d15cbef

Browse files
authored
Merge pull request #14 from Bandwidth/DX-3033
Dx 3033 Migrate to Public NPM
2 parents 3994363 + 6db2b28 commit d15cbef

File tree

8 files changed

+1163
-4012
lines changed

8 files changed

+1163
-4012
lines changed

.github/workflows/deploy-beta.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: ${{ github.event.release.prerelease }}
1212
steps:
13-
- name: Check Branch Name Format
14-
run: |
15-
re=v[0-9]+.[0-9]+.[0-9]+-beta
16-
if ! [[ ${{ github.event.release.target_commitish }} =~ $re ]]; then
17-
echo 'Target branch does not match expected regex pattern for beta releases (v[0-9]+.[0-9]+.[0-9]+-beta)'
18-
echo '${{ github.event.release.target_commitish }}'
19-
echo 'Please update your branch name to match the expected regex pattern'
20-
exit 1
21-
fi
22-
2313
- name: Set Release Version
2414
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
2515

@@ -32,20 +22,25 @@ jobs:
3222
echo 'Please update your tag to match the expected regex pattern'
3323
exit 1
3424
fi
35-
25+
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
3629
- name: Setup Node
37-
uses: actions/setup-node@v2
30+
uses: actions/setup-node@v3
3831
with:
39-
node-version: '16'
40-
registry-url: 'https://npm.pkg.github.com'
32+
node-version: "18"
33+
registry-url: 'https://registry.npmjs.org'
4134

4235
- name: Build and Test npm Package
4336
run: |
44-
npm install
45-
npm run build
46-
npm run test
37+
npm install
38+
npm run build
39+
npm run test
4740
4841
- name: Publish npm Package
4942
run: |
50-
npm version $RELEASE_VERSION --no-git-tag-version
51-
npm publish --tag beta
43+
npm version $RELEASE_VERSION --no-git-tag-version
44+
npm publish --access public --tag beta
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@ jobs:
99
runs-on: ubuntu-latest
1010
if: ${{ !github.event.release.prerelease && github.event.release.target_commitish == 'main' }}
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
12+
- name: Checkout
13+
uses: actions/checkout@v3
1414

15-
- name: Set Release Version
16-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
15+
- name: Set Release Version
16+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
1717

18-
- name: Setup Node
19-
uses: actions/setup-node@v2
20-
with:
21-
node-version: '16'
22-
registry-url: 'https://npm.pkg.github.com'
18+
- name: Setup Node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: "18"
22+
registry-url: 'https://registry.npmjs.org'
2323

24-
- name: Build and Test npm Package
25-
run: |
26-
npm install
27-
npm run build
28-
npm run test
24+
- name: Build and Test npm Package
25+
run: |
26+
npm install
27+
npm run build
28+
npm run test
2929
30-
- name: Publish npm Package
31-
run: |
32-
npm version $RELEASE_VERSION --no-git-tag-version
33-
npm publish
34-
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Publish npm Package
31+
run: |
32+
npm version $RELEASE_VERSION --no-git-tag-version
33+
npm publish --access public
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

.github/workflows/test.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ on:
66

77
jobs:
88
test:
9-
name: Test
9+
name: Test
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [14, 16, 18, 'latest']
1114
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
15+
- name: Checkout
16+
uses: actions/checkout@v3
1417

15-
- name: Setup Node
16-
uses: actions/setup-node@v2
17-
with:
18-
node-version: 16
18+
- name: Setup Node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
1922

20-
- name: Test
21-
run: |
22-
npm install
23-
npm run test
23+
- name: Test
24+
run: |
25+
npm install
26+
npm run test

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
# oas-linter-cli
22

3-
This is a CLI tool that enables users to run an OAS (Open API Spec) file through the DevX ruleset before opening a pull request against [api-specs](https://github.com/Bandwidth/api-specs)
3+
This is a CLI tool that enables users to run an OAS (Open API Spec) file through Bandwidth's custom [Stoplight ruleset](https://docs.stoplight.io/docs/spectral/e5b9616d6d50c-rulesets).
44

55
## Setup and Install
66

77
```sh
8-
# if your npm profile isnt setup to download npm packages published to githubs npm registry - run these commands first
9-
npm login --registry https://npm.pkg.github.com # Requires a github token with Bandwidth SSO access
10-
npm config set @Bandwidth:registry https://npm.pkg.github.com
11-
12-
# note the uppercase `B`
13-
npm install -g @Bandwidth/oas-linter-cli
8+
npm install -g @bandwidth/oas-linter-cli
149
```
1510

1611
## Usage
1712

1813
```sh
19-
bw-oas-lint -h # Help
20-
bw-oas-lint lint ../path/to/my/spec.yml # must be in Yaml format
21-
22-
# add -s flag to save the terminal output to a .json file in your home directory
14+
bw-oas-linter lint ../path/to/my/spec.yml # json also supported
2315
```
2416

25-
## Uninstall
17+
### Options
18+
19+
Run `bw-oas-linter lint -h` for a list of options.
20+
21+
| Flag | Description |
22+
|:----:|:------------|
23+
| -s | Save linter result to users home directory |
24+
| -j | Output JSON |
25+
| -r | Path to custom spectral ruleset file |
26+
| -h | Print help menu |
27+
| -v | Print package version |
28+
29+
30+
## Uninstall
2631

2732
```sh
28-
# note the lowercase `b`
2933
npm uninstall -g @bandwidth/oas-linter-cli
3034
```

0 commit comments

Comments
 (0)