Skip to content

Commit a9948ad

Browse files
Merge pull request #43 from DSACMS/sachin/versioningUpdates
Changed dependency strategy to docker
2 parents b92b9aa + 2e4bc43 commit a9948ad

8 files changed

Lines changed: 46 additions & 68 deletions

File tree

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
dist
3+
.git
4+
.github
5+
*.md
6+
.gitignore
7+
.npmrc
8+
coverage
9+
.env
10+
*.log

.github/workflows/updateCodeJSON.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,8 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717

18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: "20"
22-
23-
- name: Setup Go
24-
uses: actions/setup-go@v5
25-
with:
26-
go-version: "1.22"
27-
28-
- name: Install SCC
29-
run: go install github.com/boyter/scc/v3@latest
30-
3118
- name: Update code.json
32-
uses: ./
19+
uses: DSACMS/automated-codejson-generator@main
3320
with:
3421
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
BRANCH: "main"
22+
BRANCH: "main"

GOVERNANCE.md

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

action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ inputs:
77
description: "GitHub token used for API access"
88
required: true
99
default: ${{ github.token }}
10+
1011
BRANCH:
1112
description: "Name of the branch the PR is sent to"
1213
required: false
@@ -19,5 +20,9 @@ outputs:
1920
description: "URL of the created pull request if changes were made"
2021

2122
runs:
22-
using: node20
23-
main: dist/index.js
23+
using: docker
24+
image: Dockerfile
25+
26+
branding:
27+
icon: 'file-text'
28+
color: 'blue'

code.json

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,18 @@
2424
"forks": 0,
2525
"clones": 0
2626
},
27-
"platforms": [
28-
"web",
29-
"linux"
30-
],
31-
"categories": [
32-
"developer-tools",
33-
"automation"
34-
],
27+
"platforms": ["web", "linux"],
28+
"categories": ["developer-tools", "automation"],
3529
"softwareType": "standalone/backend",
36-
"languages": [
37-
"TypeScript",
38-
"JavaScript"
39-
],
30+
"languages": ["TypeScript", "JavaScript"],
4031
"maintenance": "internal",
4132
"contractNumber": "",
4233
"date": {
4334
"created": "2025-02-07T16:29:38Z",
4435
"lastModified": "2025-06-06T17:48:49Z",
4536
"metaDataLastUpdated": "2025-06-06T17:49:37.841Z"
4637
},
47-
"tags": [
48-
"github-action",
49-
"codejson"
50-
],
38+
"tags": ["github-action", "codejson"],
5139
"contact": {
5240
"email": "opensource@cms.hhs.gov",
5341
"name": "CMS Open Source Team"
@@ -63,11 +51,7 @@
6351
"projects": [],
6452
"systems": [],
6553
"upstream": "",
66-
"subsetInHealthcare": [
67-
"Operational"
68-
],
69-
"userType": [
70-
"Government"
71-
],
54+
"subsetInHealthcare": ["Operational"],
55+
"userType": ["Government"],
7256
"maturityModelTier": 3
73-
}
57+
}

dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM node:20-alpine
2+
3+
RUN apk add --no-cache go git
4+
5+
RUN go install github.com/boyter/scc/v3@latest
6+
7+
WORKDIR /action
8+
9+
COPY package*.json ./
10+
RUN npm ci
11+
12+
COPY . .
13+
14+
RUN npm run bundle
15+
16+
ENV PATH="/root/go/bin:${PATH}"
17+
18+
ENTRYPOINT ["node", "/action/dist/index.js"]

src/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async function getBasicInfo(): Promise<BasicRepoInfo> {
8181

8282
async function getLaborHours(): Promise<number> {
8383
try {
84-
const { stdout } = await execAsync(`scc . --format json2`);
84+
const { stdout } = await execAsync(`scc /github/workspace --format json2`);
8585
const sccData = JSON.parse(stdout);
8686

8787
const laborHours = Math.ceil(

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async function getMetaData(
8585
}
8686

8787
export async function run(): Promise<void> {
88-
const currentCodeJSON = await helpers.readJSON("./code.json");
88+
const currentCodeJSON = await helpers.readJSON("/github/workspace/code.json");
8989
const metaData = await getMetaData(currentCodeJSON);
9090
let finalCodeJSON = {} as CodeJSON;
9191

0 commit comments

Comments
 (0)