Skip to content

Commit aa5ed74

Browse files
Inherit from gov-codejson with tests (#102)
* created script to pull from source model and created tests * changing branch name for testing * created a test action * sytanx issue * Reverting back to feature branch * added run script and logging
1 parent e14ddcc commit aa5ed74

13 files changed

Lines changed: 1763 additions & 496 deletions

File tree

.DS_Store

-6 KB
Binary file not shown.

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests
27+
run: npm run test

.github/workflows/updateCodeJSON.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: Update code.json
2424
id: generator
25-
uses: DSACMS/automated-codejson-generator@v1.2.1
25+
uses: DSACMS/automated-codejson-generator@sachin/inheriting-from-source-model
2626
with:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
ADMIN_TOKEN: ${{ secrets.ADMIN_PAT }}

package-lock.json

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@
3333
"package": "npx rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
3434
"package:watch": "npm run package -- --watch",
3535
"test": "NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest",
36-
"all": "npm run format:write && npm run lint && npm run test && npm run coverage && npm run package"
36+
"all": "npm run format:write && npm run lint && npm run test && npm run coverage && npm run package",
37+
"generate-schema": "npx tsx src/scripts/generate-schema.ts"
3738
},
3839
"license": "MIT",
3940
"dependencies": {
4041
"@actions/core": "^1.11.1",
4142
"@octokit/action": "^7.0.0",
43+
"json-schema-to-zod": "^2.7.0",
4244
"octokit-plugin-create-pull-request": "^6.0.0",
43-
"zod": "^4.1.11"
45+
"zod": "^4.2.1"
4446
},
4547
"devDependencies": {
4648
"@eslint/compat": "^1.2.6",

src/__tests__/fixtures/test-code.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
"name": "automated-codejson-generator",
33
"version": "1.0.0",
44
"description": "A GitHub Action that generates code.json files",
5-
"longDescription": "This action helps federal agencies maintain code.json files for compliance.",
5+
"longDescription": "This action helps federal agencies maintain code.json files for compliance with federal open source policy requirements. It automates the generation of standardized code.json metadata files.",
66
"status": "Production",
77
"permissions": {
88
"licenses": [
99
{
10-
"name": "CC0 1.0 Universal",
10+
"name": "CC0-1.0",
1111
"URL": "https://creativecommons.org/publicdomain/zero/1.0/"
1212
}
1313
],
1414
"usageType": ["openSource"],
15-
"exemptionText": ""
15+
"exemptionText": null
1616
},
17-
"organization": "DSACMS",
17+
"organization": "Centers for Medicare & Medicaid Services",
1818
"repositoryURL": "https://github.com/DSACMS/automated-codejson-generator",
19-
"repositoryHost": "github",
19+
"repositoryHost": "github.com/DSACMS",
2020
"repositoryVisibility": "public",
2121
"vcs": "git",
2222
"laborHours": 500,
2323
"reuseFrequency": {
2424
"forks": 10,
2525
"clones": 50
2626
},
27-
"platforms": ["github-actions"],
27+
"platforms": ["web", "linux"],
2828
"categories": ["compliance", "automation"],
29-
"softwareType": "tool",
29+
"softwareType": "standalone/other",
3030
"languages": ["TypeScript"],
31-
"maintenance": "active",
32-
"contractNumber": [],
31+
"maintenance": "internal",
32+
"contractNumber": ["CONTRACT-001"],
3333
"SBOM": "https://github.com/DSACMS/automated-codejson-generator/network/dependencies",
3434
"date": {
3535
"created": "2024-01-01T00:00:00Z",
@@ -44,13 +44,13 @@
4444
"feedbackMechanism": "https://github.com/DSACMS/automated-codejson-generator/issues",
4545
"AIUseCaseID": "0",
4646
"localisation": false,
47-
"repositoryType": "source",
47+
"repositoryType": "tools",
4848
"userInput": false,
4949
"fismaLevel": "low",
5050
"group": "DSACMS",
51-
"projects": [],
51+
"projects": ["automated-codejson-generator"],
5252
"systems": [],
53-
"subsetInHealthcare": [],
54-
"userType": ["developer"],
53+
"subsetInHealthcare": ["operational"],
54+
"userType": ["government"],
5555
"maturityModelTier": 1
56-
}
56+
}

0 commit comments

Comments
 (0)