Skip to content

Commit f4cf07d

Browse files
authored
Merge pull request #174 from uswds/develop
Sync develop branch with main
2 parents 8ac4af4 + affe78c commit f4cf07d

6 files changed

Lines changed: 712 additions & 306 deletions

File tree

.browserslistrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Supported browsers
22
> 2%
33
last 2 versions
4-
IE 11
54
not dead

.github/workflows/add-to-project.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin v6.0.2
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # pin v4.35.1
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
56+
uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # pin v4.35.1
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
70+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # pin v4.35.1

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
id-token: write # Required for OIDC
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin v6.0.2
17+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # pin v6.3.0
18+
with:
19+
node-version: '20.x'
20+
registry-url: 'https://registry.npmjs.org'
21+
- name: Update npm version
22+
run: npm install -g npm@latest # OIDC requires npm v11.5.1 or later
23+
- run: npm ci
24+
- name: Check for vulnerabilities
25+
run: |
26+
# Capture audit result (ignore exit code with || true)
27+
AUDIT_RESULT=$(npm audit --json || true)
28+
CRITICAL=$(echo $AUDIT_RESULT | jq '.metadata.vulnerabilities.critical // 0')
29+
HIGH=$(echo $AUDIT_RESULT | jq '.metadata.vulnerabilities.high // 0')
30+
TOTAL=$(echo $AUDIT_RESULT | jq '.metadata.vulnerabilities.total // 0')
31+
32+
if [ "$CRITICAL" -gt 0 ] || [ "$HIGH" -gt 0 ]; then
33+
echo "Found $CRITICAL critical and $HIGH high severity vulnerabilities"
34+
echo "Please review and fix these vulnerabilities"
35+
exit 1
36+
fi
37+
echo "No critical or high severity vulnerabilities found. Total vulnerabilities: $TOTAL"
38+
- name: Pack package
39+
run: npm pack
40+
- name: Upload pack artifact
41+
if: ${{ !env.ACT }}
42+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # pin v7.0.0
43+
with:
44+
name: npm-pack
45+
path: "*.tgz"
46+
- run: npm publish
47+
if: ${{ !env.ACT }}

0 commit comments

Comments
 (0)