Skip to content

Commit eba09ce

Browse files
authored
Merge pull request #28 from byu-oit/node20
Use Node.js v20, bump dependencies, refer to Tyk, improve CI
2 parents 3e8f823 + 633ce80 commit eba09ce

File tree

7 files changed

+1980
-3431
lines changed

7 files changed

+1980
-3431
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,90 @@
11
name: CI
2+
23
on:
34
pull_request:
45
push:
56
branches:
67
- staging
78
- 'v*'
89
env:
9-
node_version: "16.x"
10+
node_version: "20.x"
11+
FORCE_COLOR: 3
1012

1113
jobs:
1214
build: # make sure build/ci work properly
1315
name: Build
1416
runs-on: ubuntu-latest
1517
steps:
16-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1719
- name: Set up Node.js
18-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
1921
with:
2022
node-version: ${{ env.node_version }}
2123

22-
- name: npm install
23-
run: npm install
24+
- name: npm ci
25+
run: npm ci --prefer-offline
2426

25-
- name: npm run pack
27+
- name: npm run package
2628
run: npm run package
2729

30+
- name: Check for any changed files
31+
run: |
32+
[[ -z $(git status --untracked-files=no --porcelain) ]] || \
33+
(echo "::error title=npm run package::Files in the /dist directory shouldn't have changed. You forgot to run 'npm run package'." && exit 1)
34+
2835
audit:
2936
name: Audit
3037
runs-on: ubuntu-latest
3138
steps:
32-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
3340

3441
- name: Set up Node.js
35-
uses: actions/setup-node@v3
42+
uses: actions/setup-node@v4
3643
with:
3744
node-version: ${{ env.node_version }}
3845

46+
# We don't need to install deps to audit them
47+
3948
- name: npm audit
4049
run: npm audit --audit-level=critical
4150

4251
lint:
4352
name: Lint
4453
runs-on: ubuntu-latest
4554
steps:
46-
- uses: actions/checkout@v3
55+
- uses: actions/checkout@v4
4756

4857
- name: Set up Node.js
49-
uses: actions/setup-node@v3
58+
uses: actions/setup-node@v4
5059
with:
5160
node-version: ${{ env.node_version }}
61+
cache: npm
62+
cache-dependency-path: '**/package-lock.json'
5263

53-
- name: npm install
54-
run: npm install
64+
- name: npm ci
65+
run: npm ci --prefer-offline
5566

5667
- name: npm lint
5768
run: npm run lint
5869

59-
# When tests are added to the code uncomment
60-
# test-code:
70+
# test:
6171
# name: Test
6272
# runs-on: ubuntu-latest
6373
# steps:
64-
# - uses: actions/checkout@v3
74+
# - uses: actions/checkout@v4
6575
#
6676
# - name: Set up Node.js
67-
# uses: actions/setup-node@v3
77+
# uses: actions/setup-node@v4
6878
# with:
6979
# node-version: ${{ env.node_version }}
80+
# cache: npm
81+
# cache-dependency-path: '**/package-lock.json'
7082
#
71-
# - name: npm install
72-
# run: npm install
83+
# - name: npm ci
84+
# run: npm ci --prefer-offline
7385
#
7486
# - name: npm test
7587
# run: npm test
88+
#
89+
# - name: Report test coverage to Codecov
90+
# uses: codecov/codecov-action@v3

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: End Standard Change - Deploy Failed
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Start Standard Change
1414
uses: byu-oit/github-action-start-standard-change@v1
1515
id: start-standard-change
@@ -31,7 +31,7 @@ jobs:
3131
needs: end-standard-change-deploy-failed
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
- name: Start Standard Change
3636
uses: byu-oit/github-action-start-standard-change@v1
3737
id: start-standard-change

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A GitHub Action for ending standard change RFCs in BYU's ServiceNow system
88

99
### Get the inputs
1010

11-
* Get an application in WSO2 that's subscribed to [ServiceNowTableAPI - v1](https://api.byu.edu/store/apis/info?name=ServiceNowTableAPI&version=v1&provider=BYU%2Fthirschi), [StandardChange - v1](https://api.byu.edu/store/apis/info?name=StandardChange&version=v1&provider=BYU%2Fdlb44), [Change_Request - v1](https://api.byu.edu/store/apis/info?name=Change_Request&version=v1&provider=BYU%2Fthirschi), and [Echo - v1](https://api.byu.edu/store/apis/info?name=Echo&version=v1&provider=BYU%2Fbcwinter)
11+
* Get client credentials from Tyk
1212
> In the `byu-oit` GitHub organization, we provide the following secrets to every repo:
1313
> - `STANDARD_CHANGE_PRODUCTION_CLIENT_KEY`
1414
> - `STANDARD_CHANGE_PRODUCTION_CLIENT_SECRET`

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: 'BYU ServiceNow - End Standard Change RFC'
22
description: 'Ends a Standard Change RFC in BYUs ServiceNow system.'
33
inputs:
44
client-key:
5-
description: 'The WSO2 Client Key to use when calling the ServiceNow API'
5+
description: 'The Tyk Client Key to use when calling the ServiceNow API'
66
required: true
77
client-secret:
8-
description: 'The WSO2 Client Secret to use when calling the ServiceNow API'
8+
description: 'The Tyk Client Secret to use when calling the ServiceNow API'
99
required: true
1010
change-sys-id:
1111
description: 'The ID of the Standard Change RFC (Ex: "7bb66e551bb81c10be7cb992cc4bcb9d")'
@@ -17,5 +17,5 @@ inputs:
1717
description: 'Was the RFC successful? "true" or "false"'
1818
required: true
1919
runs:
20-
using: 'node16'
20+
using: 'node20'
2121
main: 'dist/index.js'

dist/index.js

Lines changed: 296 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)