Skip to content

Commit

Permalink
Merge pull request #28 from byu-oit/node20
Browse files Browse the repository at this point in the history
Use Node.js v20, bump dependencies, refer to Tyk, improve CI
  • Loading branch information
GaryGSC authored Sep 26, 2024
2 parents 3e8f823 + 633ce80 commit eba09ce
Show file tree
Hide file tree
Showing 7 changed files with 1,980 additions and 3,431 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,75 +1,90 @@
name: CI

on:
pull_request:
push:
branches:
- staging
- 'v*'
env:
node_version: "16.x"
node_version: "20.x"
FORCE_COLOR: 3

jobs:
build: # make sure build/ci work properly
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: npm install
run: npm install
- name: npm ci
run: npm ci --prefer-offline

- name: npm run pack
- name: npm run package
run: npm run package

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

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

# We don't need to install deps to audit them

- name: npm audit
run: npm audit --audit-level=critical

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: npm
cache-dependency-path: '**/package-lock.json'

- name: npm install
run: npm install
- name: npm ci
run: npm ci --prefer-offline

- name: npm lint
run: npm run lint

# When tests are added to the code uncomment
# test-code:
# test:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
#
# - name: Set up Node.js
# uses: actions/setup-node@v3
# uses: actions/setup-node@v4
# with:
# node-version: ${{ env.node_version }}
# cache: npm
# cache-dependency-path: '**/package-lock.json'
#
# - name: npm install
# run: npm install
# - name: npm ci
# run: npm ci --prefer-offline
#
# - name: npm test
# run: npm test
#
# - name: Report test coverage to Codecov
# uses: codecov/codecov-action@v3
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: End Standard Change - Deploy Failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Start Standard Change
uses: byu-oit/github-action-start-standard-change@v1
id: start-standard-change
Expand All @@ -31,7 +31,7 @@ jobs:
needs: end-standard-change-deploy-failed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Start Standard Change
uses: byu-oit/github-action-start-standard-change@v1
id: start-standard-change
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A GitHub Action for ending standard change RFCs in BYU's ServiceNow system

### Get the inputs

* 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)
* Get client credentials from Tyk
> In the `byu-oit` GitHub organization, we provide the following secrets to every repo:
> - `STANDARD_CHANGE_PRODUCTION_CLIENT_KEY`
> - `STANDARD_CHANGE_PRODUCTION_CLIENT_SECRET`
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: 'BYU ServiceNow - End Standard Change RFC'
description: 'Ends a Standard Change RFC in BYUs ServiceNow system.'
inputs:
client-key:
description: 'The WSO2 Client Key to use when calling the ServiceNow API'
description: 'The Tyk Client Key to use when calling the ServiceNow API'
required: true
client-secret:
description: 'The WSO2 Client Secret to use when calling the ServiceNow API'
description: 'The Tyk Client Secret to use when calling the ServiceNow API'
required: true
change-sys-id:
description: 'The ID of the Standard Change RFC (Ex: "7bb66e551bb81c10be7cb992cc4bcb9d")'
Expand All @@ -17,5 +17,5 @@ inputs:
description: 'Was the RFC successful? "true" or "false"'
required: true
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
297 changes: 296 additions & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit eba09ce

Please sign in to comment.